Skip to content

anshulkansal121/LeetCode

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

Array

0018-4sum
0026-remove-duplicates-from-sorted-array
0033-search-in-rotated-sorted-array
0034-find-first-and-last-position-of-element-in-sorted-array
0035-search-insert-position
0039-combination-sum
0040-combination-sum-ii
0046-permutations
0047-permutations-ii
0048-rotate-image
0051-n-queens
0054-spiral-matrix
0078-subsets
0081-search-in-rotated-sorted-array-ii
0090-subsets-ii
0128-longest-consecutive-sequence
0153-find-minimum-in-rotated-sorted-array
0162-find-peak-element
0167-two-sum-ii-input-array-is-sorted
0189-rotate-array
0204-count-primes
0209-minimum-size-subarray-sum
0216-combination-sum-iii
0229-majority-element-ii
0485-max-consecutive-ones
0496-next-greater-element-i
0503-next-greater-element-ii
0540-single-element-in-a-sorted-array
0560-subarray-sum-equals-k
0624-maximum-distance-in-arrays
0643-maximum-average-subarray-i
0724-find-pivot-index
0735-asteroid-collision
0870-magic-squares-in-grid
0890-lemonade-change
0921-spiral-matrix-iii
0943-sum-of-subarray-minimums
0966-binary-subarrays-with-sum
1002-maximum-width-ramp
1063-best-sightseeing-pair
1370-count-number-of-nice-subarrays
1392-find-the-difference-of-two-arrays
1468-check-if-n-and-its-double-exist
1538-maximum-points-you-can-obtain-from-cards
1586-longest-subarray-of-1s-after-deleting-one-element
1691-minimum-number-of-days-to-disconnect-island
1694-make-sum-divisible-by-p
1798-max-number-of-k-sum-pairs
1833-find-the-highest-altitude
1878-check-if-array-is-sorted-and-rotated
2006-find-the-student-that-will-replace-the-chalk
2067-maximum-number-of-points-with-cost
2132-convert-1d-array-into-2d-array
2227-sum-of-subarray-ranges
2232-adding-spaces-to-a-string
2428-equal-row-and-column-pairs
2616-maximal-score-after-applying-k-operations
2640-maximum-number-of-integers-to-choose-from-a-range-i
2695-find-score-of-an-array-after-marking-all-elements
3427-special-array-ii
3526-minimum-number-of-flips-to-make-binary-grid-palindromic-i

Matrix

0048-rotate-image
0054-spiral-matrix
0870-magic-squares-in-grid
0921-spiral-matrix-iii
1691-minimum-number-of-days-to-disconnect-island
2132-convert-1d-array-into-2d-array
2428-equal-row-and-column-pairs
3526-minimum-number-of-flips-to-make-binary-grid-palindromic-i

Simulation

0054-spiral-matrix
0735-asteroid-collision
0921-spiral-matrix-iii
2006-find-the-student-that-will-replace-the-chalk
2132-convert-1d-array-into-2d-array
2232-adding-spaces-to-a-string
2428-equal-row-and-column-pairs
2695-find-score-of-an-array-after-marking-all-elements

Math

0029-divide-two-integers
0048-rotate-image
0050-powx-n
0070-climbing-stairs
0189-rotate-array
0204-count-primes
0231-power-of-two
0273-integer-to-english-words
0650-2-keys-keyboard
0870-magic-squares-in-grid
1370-count-number-of-nice-subarrays

String

0003-longest-substring-without-repeating-characters
0008-string-to-integer-atoi
0022-generate-parentheses
0072-edit-distance
0131-palindrome-partitioning
0151-reverse-words-in-a-string
0273-integer-to-english-words
0402-remove-k-digits
0424-longest-repeating-character-replacement
0451-sort-characters-by-frequency
0920-uncommon-words-from-two-sentences
0957-minimum-add-to-make-parentheses-valid
1566-check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence
1715-split-a-string-into-the-max-number-of-unique-substrings
1777-determine-if-two-strings-are-close
2232-adding-spaces-to-a-string
3018-make-string-a-subsequence-using-cyclic-increments

Recursion

0025-reverse-nodes-in-k-group
0050-powx-n
0231-power-of-two
0273-integer-to-english-words

Prefix Sum

0209-minimum-size-subarray-sum
0560-subarray-sum-equals-k
0724-find-pivot-index
0966-binary-subarrays-with-sum
1538-maximum-points-you-can-obtain-from-cards
1694-make-sum-divisible-by-p
1833-find-the-highest-altitude
2006-find-the-student-that-will-replace-the-chalk
3427-special-array-ii

Sliding Window

0003-longest-substring-without-repeating-characters
0209-minimum-size-subarray-sum
0424-longest-repeating-character-replacement
0643-maximum-average-subarray-i
0966-binary-subarrays-with-sum
1370-count-number-of-nice-subarrays
1538-maximum-points-you-can-obtain-from-cards
1586-longest-subarray-of-1s-after-deleting-one-element

Dynamic Programming

0022-generate-parentheses
0070-climbing-stairs
0072-edit-distance
0131-palindrome-partitioning
0650-2-keys-keyboard
0943-sum-of-subarray-minimums
1063-best-sightseeing-pair
1586-longest-subarray-of-1s-after-deleting-one-element
2067-maximum-number-of-points-with-cost

Hash Table

0003-longest-substring-without-repeating-characters
0128-longest-consecutive-sequence
0160-intersection-of-two-linked-lists
0229-majority-element-ii
0424-longest-repeating-character-replacement
0451-sort-characters-by-frequency
0496-next-greater-element-i
0560-subarray-sum-equals-k
0870-magic-squares-in-grid
0920-uncommon-words-from-two-sentences
0966-binary-subarrays-with-sum
1370-count-number-of-nice-subarrays
1392-find-the-difference-of-two-arrays
1468-check-if-n-and-its-double-exist
1694-make-sum-divisible-by-p
1715-split-a-string-into-the-max-number-of-unique-substrings
1777-determine-if-two-strings-are-close
1798-max-number-of-k-sum-pairs
2428-equal-row-and-column-pairs
2640-maximum-number-of-integers-to-choose-from-a-range-i
2695-find-score-of-an-array-after-marking-all-elements

Two Pointers

0018-4sum
0026-remove-duplicates-from-sorted-array
0061-rotate-list
0086-partition-list
0148-sort-list
0151-reverse-words-in-a-string
0160-intersection-of-two-linked-lists
0167-two-sum-ii-input-array-is-sorted
0189-rotate-array
0528-swapping-nodes-in-a-linked-list
1468-check-if-n-and-its-double-exist
1566-check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence
1798-max-number-of-k-sum-pairs
2232-adding-spaces-to-a-string
3018-make-string-a-subsequence-using-cyclic-increments
3526-minimum-number-of-flips-to-make-binary-grid-palindromic-i

Sorting

0018-4sum
0148-sort-list
0229-majority-element-ii
0451-sort-characters-by-frequency
1468-check-if-n-and-its-double-exist
1777-determine-if-two-strings-are-close
1798-max-number-of-k-sum-pairs
2640-maximum-number-of-integers-to-choose-from-a-range-i
2695-find-score-of-an-array-after-marking-all-elements

Counting

0229-majority-element-ii
0451-sort-characters-by-frequency
0920-uncommon-words-from-two-sentences
1777-determine-if-two-strings-are-close

Union Find

0128-longest-consecutive-sequence

Linked List

0025-reverse-nodes-in-k-group
0061-rotate-list
0086-partition-list
0092-reverse-linked-list-ii
0148-sort-list
0160-intersection-of-two-linked-lists
0328-odd-even-linked-list
0528-swapping-nodes-in-a-linked-list

Tree

0112-path-sum
0113-path-sum-ii
0776-n-ary-tree-postorder-traversal

Depth-First Search

0112-path-sum
0113-path-sum-ii
0776-n-ary-tree-postorder-traversal
1691-minimum-number-of-days-to-disconnect-island

Breadth-First Search

0112-path-sum
1691-minimum-number-of-days-to-disconnect-island

Binary Tree

0112-path-sum
0113-path-sum-ii

Backtracking

0022-generate-parentheses
0039-combination-sum
0040-combination-sum-ii
0046-permutations
0047-permutations-ii
0051-n-queens
0078-subsets
0090-subsets-ii
0113-path-sum-ii
0131-palindrome-partitioning
0216-combination-sum-iii
1715-split-a-string-into-the-max-number-of-unique-substrings

Strongly Connected Component

1691-minimum-number-of-days-to-disconnect-island

Binary Search

0033-search-in-rotated-sorted-array
0034-find-first-and-last-position-of-element-in-sorted-array
0035-search-insert-position
0081-search-in-rotated-sorted-array-ii
0153-find-minimum-in-rotated-sorted-array
0162-find-peak-element
0167-two-sum-ii-input-array-is-sorted
0209-minimum-size-subarray-sum
0540-single-element-in-a-sorted-array
1468-check-if-n-and-its-double-exist
2006-find-the-student-that-will-replace-the-chalk
2640-maximum-number-of-integers-to-choose-from-a-range-i
3427-special-array-ii

Divide and Conquer

0148-sort-list

Merge Sort

0148-sort-list

Heap (Priority Queue)

0451-sort-characters-by-frequency
2616-maximal-score-after-applying-k-operations
2695-find-score-of-an-array-after-marking-all-elements

Bucket Sort

0451-sort-characters-by-frequency

Stack

0155-min-stack
0402-remove-k-digits
0496-next-greater-element-i
0503-next-greater-element-ii
0735-asteroid-collision
0776-n-ary-tree-postorder-traversal
0943-sum-of-subarray-minimums
0957-minimum-add-to-make-parentheses-valid
1002-maximum-width-ramp
2227-sum-of-subarray-ranges

Design

0155-min-stack

Greedy

0402-remove-k-digits
0624-maximum-distance-in-arrays
0890-lemonade-change
0957-minimum-add-to-make-parentheses-valid
2616-maximal-score-after-applying-k-operations
2640-maximum-number-of-integers-to-choose-from-a-range-i

Monotonic Stack

0402-remove-k-digits
0496-next-greater-element-i
0503-next-greater-element-ii
0943-sum-of-subarray-minimums
1002-maximum-width-ramp
2227-sum-of-subarray-ranges

Bit Manipulation

0029-divide-two-integers
0078-subsets
0090-subsets-ii
0231-power-of-two
2323-minimum-bit-flips-to-convert-number

Enumeration

0204-count-primes

Number Theory

0204-count-primes

Memoization

0070-climbing-stairs

String Matching

1566-check-if-a-word-occurs-as-a-prefix-of-any-word-in-a-sentence