Skip to content

Worked solutions of problems on Hackerrank, LeetCode, Codeforces, etc.

Notifications You must be signed in to change notification settings

sedfarouk/Competitive_Programming

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A collection of LeetCode questions to ace the coding interview! - Created using LeetHub v2

LeetCode Topics

Bit Manipulation

1473-find-the-longest-substring-containing-vowels-in-even-counts
2170-count-number-of-maximum-bitwise-or-subsets
2323-minimum-bit-flips-to-convert-number

Array

0001-two-sum
0015-3sum
0016-3sum-closest
0031-next-permutation
0042-trapping-rain-water
0088-merge-sorted-array
0128-longest-consecutive-sequence
0139-word-break
0164-maximum-gap
0239-sliding-window-maximum
0330-patching-array
0399-evaluate-division
0632-smallest-range-covering-elements-from-k-lists
0912-random-pick-with-weight
1002-maximum-width-ramp
1016-subarray-sums-divisible-by-k
1256-rank-transform-of-an-array
1414-shortest-path-in-a-grid-with-obstacles-elimination
1620-check-if-array-pairs-are-divisible-by-k
1694-make-sum-divisible-by-p
1775-design-an-ordered-stream
1923-sentence-similarity-iii
2054-the-number-of-the-smallest-unoccupied-chair
2170-count-number-of-maximum-bitwise-or-subsets
2176-parallel-courses-iii
2488-divide-intervals-into-minimum-number-of-groups
2616-maximal-score-after-applying-k-operations

Greedy

0330-patching-array
0632-smallest-range-covering-elements-from-k-lists
0670-maximum-swap
0957-minimum-add-to-make-parentheses-valid
1304-longest-happy-string
2095-minimum-number-of-swaps-to-make-the-string-balanced
2488-divide-intervals-into-minimum-number-of-groups
2616-maximal-score-after-applying-k-operations
3195-separate-black-and-white-balls

Breadth-First Search

0103-binary-tree-zigzag-level-order-traversal
0399-evaluate-division
1414-shortest-path-in-a-grid-with-obstacles-elimination
2677-cousins-in-binary-tree-ii

Matrix

1414-shortest-path-in-a-grid-with-obstacles-elimination

String

0020-valid-parentheses
0076-minimum-window-substring
0139-word-break
0242-valid-anagram
0387-first-unique-character-in-a-string
0394-decode-string
0399-evaluate-division
0957-minimum-add-to-make-parentheses-valid
1030-smallest-string-starting-from-leaf
1304-longest-happy-string
1473-find-the-longest-substring-containing-vowels-in-even-counts
1512-design-underground-system
1715-split-a-string-into-the-max-number-of-unique-substrings
1923-sentence-similarity-iii
2095-minimum-number-of-swaps-to-make-the-string-balanced
2217-step-by-step-directions-from-a-binary-tree-node-to-another
2800-minimum-string-length-after-removing-substrings
3195-separate-black-and-white-balls

Tree

0098-validate-binary-search-tree
0103-binary-tree-zigzag-level-order-traversal
0988-flip-equivalent-binary-trees
1030-smallest-string-starting-from-leaf
2217-step-by-step-directions-from-a-binary-tree-node-to-another
2677-cousins-in-binary-tree-ii

Depth-First Search

0098-validate-binary-search-tree
0399-evaluate-division
0766-flatten-a-multilevel-doubly-linked-list
0988-flip-equivalent-binary-trees
1030-smallest-string-starting-from-leaf
2217-step-by-step-directions-from-a-binary-tree-node-to-another
2677-cousins-in-binary-tree-ii

Binary Tree

0098-validate-binary-search-tree
0103-binary-tree-zigzag-level-order-traversal
0988-flip-equivalent-binary-trees
1030-smallest-string-starting-from-leaf
2217-step-by-step-directions-from-a-binary-tree-node-to-another
2677-cousins-in-binary-tree-ii

Math

0670-maximum-swap
0912-random-pick-with-weight

Binary Search

0912-random-pick-with-weight

Prefix Sum

0912-random-pick-with-weight
1016-subarray-sums-divisible-by-k
1473-find-the-longest-substring-containing-vowels-in-even-counts
1694-make-sum-divisible-by-p
2488-divide-intervals-into-minimum-number-of-groups

Randomized

0912-random-pick-with-weight

Hash Table

0001-two-sum
0076-minimum-window-substring
0128-longest-consecutive-sequence
0139-word-break
0146-lru-cache
0242-valid-anagram
0387-first-unique-character-in-a-string
0632-smallest-range-covering-elements-from-k-lists
1016-subarray-sums-divisible-by-k
1256-rank-transform-of-an-array
1473-find-the-longest-substring-containing-vowels-in-even-counts
1512-design-underground-system
1620-check-if-array-pairs-are-divisible-by-k
1694-make-sum-divisible-by-p
1715-split-a-string-into-the-max-number-of-unique-substrings
1775-design-an-ordered-stream
2054-the-number-of-the-smallest-unoccupied-chair
2677-cousins-in-binary-tree-ii

Sliding Window

0076-minimum-window-substring
0239-sliding-window-maximum
0632-smallest-range-covering-elements-from-k-lists

Dynamic Programming

0042-trapping-rain-water
0139-word-break
1488-sort-integers-by-the-power-value
2176-parallel-courses-iii

Graph

0399-evaluate-division
2176-parallel-courses-iii

Topological Sort

2176-parallel-courses-iii

Counting

0387-first-unique-character-in-a-string
1620-check-if-array-pairs-are-divisible-by-k

Sorting

0015-3sum
0016-3sum-closest
0088-merge-sorted-array
0164-maximum-gap
0242-valid-anagram
0632-smallest-range-covering-elements-from-k-lists
1256-rank-transform-of-an-array
1488-sort-integers-by-the-power-value
2488-divide-intervals-into-minimum-number-of-groups

Two Pointers

0015-3sum
0016-3sum-closest
0031-next-permutation
0042-trapping-rain-water
0088-merge-sorted-array
1923-sentence-similarity-iii
2095-minimum-number-of-swaps-to-make-the-string-balanced
2488-divide-intervals-into-minimum-number-of-groups
3195-separate-black-and-white-balls

Stack

0020-valid-parentheses
0042-trapping-rain-water
0394-decode-string
0957-minimum-add-to-make-parentheses-valid
1002-maximum-width-ramp
2095-minimum-number-of-swaps-to-make-the-string-balanced
2800-minimum-string-length-after-removing-substrings

Simulation

2800-minimum-string-length-after-removing-substrings

Monotonic Stack

0042-trapping-rain-water
1002-maximum-width-ramp

Heap (Priority Queue)

0239-sliding-window-maximum
0632-smallest-range-covering-elements-from-k-lists
1304-longest-happy-string
2054-the-number-of-the-smallest-unoccupied-chair
2488-divide-intervals-into-minimum-number-of-groups
2616-maximal-score-after-applying-k-operations

Linked List

0146-lru-cache
0766-flatten-a-multilevel-doubly-linked-list

Doubly-Linked List

0146-lru-cache
0766-flatten-a-multilevel-doubly-linked-list

Queue

0239-sliding-window-maximum
0387-first-unique-character-in-a-string

Monotonic Queue

0239-sliding-window-maximum

Union Find

0128-longest-consecutive-sequence
0399-evaluate-division

Shortest Path

0399-evaluate-division

Trie

0139-word-break

Memoization

0139-word-break
1488-sort-integers-by-the-power-value

Backtracking

1030-smallest-string-starting-from-leaf
1715-split-a-string-into-the-max-number-of-unique-substrings
2170-count-number-of-maximum-bitwise-or-subsets

Design

0146-lru-cache
1512-design-underground-system
1775-design-an-ordered-stream

Data Stream

1775-design-an-ordered-stream

Recursion

0394-decode-string

Binary Search Tree

0098-validate-binary-search-tree

Enumeration

2170-count-number-of-maximum-bitwise-or-subsets

Bucket Sort

0164-maximum-gap

Radix Sort

0164-maximum-gap

About

Worked solutions of problems on Hackerrank, LeetCode, Codeforces, etc.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages