Skip to content

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
2059-unique-length-3-palindromic-subsequences
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
0051-n-queens
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
0729-my-calendar-i
0912-random-pick-with-weight
1002-maximum-width-ramp
1016-subarray-sums-divisible-by-k
1256-rank-transform-of-an-array
1364-tuple-with-same-product
1414-shortest-path-in-a-grid-with-obstacles-elimination
1477-product-of-the-last-k-numbers
1524-string-matching-in-an-array
1620-check-if-array-pairs-are-divisible-by-k
1694-make-sum-divisible-by-p
1775-design-an-ordered-stream
1819-construct-the-lexicographically-largest-valid-sequence
1923-sentence-similarity-iii
2054-the-number-of-the-smallest-unoccupied-chair
2170-count-number-of-maximum-bitwise-or-subsets
2176-parallel-courses-iii
2358-number-of-ways-to-split-array
2448-count-number-of-bad-pairs
2465-shifting-letters-ii
2488-divide-intervals-into-minimum-number-of-groups
2616-maximal-score-after-applying-k-operations
3152-maximum-value-of-an-ordered-triplet-ii
3171-minimum-equal-sum-of-two-arrays-after-replacing-zeros
3434-find-the-number-of-distinct-colors-among-the-balls

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
1502-construct-k-palindrome-strings
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
3171-minimum-equal-sum-of-two-arrays-after-replacing-zeros
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
0214-shortest-palindrome
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
1502-construct-k-palindrome-strings
1512-design-underground-system
1524-string-matching-in-an-array
1537-maximum-score-after-splitting-a-string
1715-split-a-string-into-the-max-number-of-unique-substrings
1915-check-if-one-string-swap-can-make-strings-equal
1923-sentence-similarity-iii
2059-unique-length-3-palindromic-subsequences
2095-minimum-number-of-swaps-to-make-the-string-balanced
2217-step-by-step-directions-from-a-binary-tree-node-to-another
2465-shifting-letters-ii
2800-minimum-string-length-after-removing-substrings
3195-separate-black-and-white-balls
3455-minimum-length-of-string-after-operations

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
1477-product-of-the-last-k-numbers
2050-count-good-numbers
2448-count-number-of-bad-pairs

Binary Search

0729-my-calendar-i
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
1477-product-of-the-last-k-numbers
1537-maximum-score-after-splitting-a-string
1694-make-sum-divisible-by-p
2059-unique-length-3-palindromic-subsequences
2358-number-of-ways-to-split-array
2465-shifting-letters-ii
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
1364-tuple-with-same-product
1473-find-the-longest-substring-containing-vowels-in-even-counts
1502-construct-k-palindrome-strings
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
1915-check-if-one-string-swap-can-make-strings-equal
2054-the-number-of-the-smallest-unoccupied-chair
2059-unique-length-3-palindromic-subsequences
2448-count-number-of-bad-pairs
2677-cousins-in-binary-tree-ii
3434-find-the-number-of-distinct-colors-among-the-balls
3455-minimum-length-of-string-after-operations

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
0836-race-car
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
1364-tuple-with-same-product
1502-construct-k-palindrome-strings
1620-check-if-array-pairs-are-divisible-by-k
1915-check-if-one-string-swap-can-make-strings-equal
2448-count-number-of-bad-pairs
3455-minimum-length-of-string-after-operations

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
3434-find-the-number-of-distinct-colors-among-the-balls

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

0051-n-queens
1030-smallest-string-starting-from-leaf
1715-split-a-string-into-the-max-number-of-unique-substrings
1819-construct-the-lexicographically-largest-valid-sequence
2170-count-number-of-maximum-bitwise-or-subsets

Design

0146-lru-cache
0729-my-calendar-i
1477-product-of-the-last-k-numbers
1512-design-underground-system
1775-design-an-ordered-stream

Data Stream

1477-product-of-the-last-k-numbers
1775-design-an-ordered-stream

Recursion

0394-decode-string
2050-count-good-numbers

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

String Matching

0214-shortest-palindrome
1524-string-matching-in-an-array

Segment Tree

0729-my-calendar-i

Ordered Set

0729-my-calendar-i

Rolling Hash

0214-shortest-palindrome

Hash Function

0214-shortest-palindrome

About

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

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages