Skip to content

A collection of LeetCode questions to ace the coding interview! - Created using [LeetHub v2](https://github.com/arunbhardwaj/LeetHub-2.0)

Notifications You must be signed in to change notification settings

Shailendra0801/Placement-Sprint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Placement-Sprint

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

LeetCode Topics

Array

0004-median-of-two-sorted-arrays
0011-container-with-most-water
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
0042-trapping-rain-water
0045-jump-game-ii
0048-rotate-image
0055-jump-game
0066-plus-one
0074-search-a-2d-matrix
0080-remove-duplicates-from-sorted-array-ii
0081-search-in-rotated-sorted-array-ii
0088-merge-sorted-array
0118-pascals-triangle
0119-pascals-triangle-ii
0121-best-time-to-buy-and-sell-stock
0122-best-time-to-buy-and-sell-stock-ii
0153-find-minimum-in-rotated-sorted-array
0162-find-peak-element
0169-majority-element
0179-largest-number
0189-rotate-array
0209-minimum-size-subarray-sum
0217-contains-duplicate
0219-contains-duplicate-ii
0238-product-of-array-except-self
0240-search-a-2d-matrix-ii
0274-h-index
0349-intersection-of-two-arrays
0380-insert-delete-getrandom-o1
0381-insert-delete-getrandom-o1-duplicates-allowed
0419-battleships-in-a-board
0453-minimum-moves-to-equal-array-elements
0496-next-greater-element-i
0539-minimum-time-difference
0632-smallest-range-covering-elements-from-k-lists
0729-my-calendar-i
0731-my-calendar-ii
0739-daily-temperatures
0822-unique-morse-code-words
0859-design-circular-deque
0860-design-circular-queue
0873-guess-the-word
0906-walking-robot-simulation
1002-maximum-width-ramp
1019-squares-of-a-sorted-array
1127-last-stone-weight
1256-rank-transform-of-an-array
1350-remove-sub-folders-from-the-filesystem
1435-xor-queries-of-a-subarray
1497-design-a-stack-with-increment-operation
1620-check-if-array-pairs-are-divisible-by-k
1694-make-sum-divisible-by-p
1786-count-the-number-of-consistent-strings
1798-max-number-of-k-sum-pairs
1848-sum-of-unique-elements
1899-count-items-matching-a-rule
1923-sentence-similarity-iii
1940-maximum-xor-for-each-query
2006-find-the-student-that-will-replace-the-chalk
2015-determine-whether-matrix-can-be-obtained-by-rotation
2054-the-number-of-the-smallest-unoccupied-chair
2132-convert-1d-array-into-2d-array
2155-find-missing-observations
2170-count-number-of-maximum-bitwise-or-subsets
2179-most-beautiful-item-for-each-query
2188-minimized-maximum-of-products-distributed-to-any-store
2190-count-common-words-with-one-occurrence
2350-find-closest-number-to-zero
2356-largest-combination-with-bitwise-and-greater-than-zero
2411-spiral-matrix-iv
2412-minimum-amount-of-time-to-fill-cups
2423-minimum-deletions-to-make-array-divisible
2488-divide-intervals-into-minimum-number-of-groups
2494-sum-of-prefix-scores-of-strings
2503-longest-subarray-with-maximum-bitwise-and
2551-apply-operations-to-an-array
2581-divide-players-into-teams-of-equal-skill
2616-maximal-score-after-applying-k-operations
2675-find-the-width-of-columns-of-a-grid
2699-count-the-number-of-fair-pairs
2755-extra-characters-in-a-string
2876-number-of-employees-who-met-the-target
3249-minimum-number-of-operations-to-make-array-xor-equal-to-k
3291-find-if-array-can-be-sorted
3329-find-the-length-of-the-longest-common-prefix
3380-shortest-subarray-with-or-at-least-k-ii
3501-delete-nodes-from-linked-list-present-in-array

Hash Table

0003-longest-substring-without-repeating-characters
0013-roman-to-integer
0160-intersection-of-two-linked-lists
0169-majority-element
0205-isomorphic-strings
0217-contains-duplicate
0219-contains-duplicate-ii
0242-valid-anagram
0290-word-pattern
0349-intersection-of-two-arrays
0380-insert-delete-getrandom-o1
0381-insert-delete-getrandom-o1-duplicates-allowed
0383-ransom-note
0387-first-unique-character-in-a-string
0432-all-oone-data-structure
0438-find-all-anagrams-in-a-string
0496-next-greater-element-i
0567-permutation-in-string
0632-smallest-range-covering-elements-from-k-lists
0822-unique-morse-code-words
0906-walking-robot-simulation
0920-uncommon-words-from-two-sentences
1256-rank-transform-of-an-array
1473-find-the-longest-substring-containing-vowels-in-even-counts
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
1786-count-the-number-of-consistent-strings
1798-max-number-of-k-sum-pairs
1848-sum-of-unique-elements
2054-the-number-of-the-smallest-unoccupied-chair
2190-count-common-words-with-one-occurrence
2356-largest-combination-with-bitwise-and-greater-than-zero
2581-divide-players-into-teams-of-equal-skill
2677-cousins-in-binary-tree-ii
2755-extra-characters-in-a-string
2825-minimize-string-length
3329-find-the-length-of-the-longest-common-prefix
3501-delete-nodes-from-linked-list-present-in-array

Counting

0169-majority-element
0383-ransom-note
0387-first-unique-character-in-a-string
0920-uncommon-words-from-two-sentences
1620-check-if-array-pairs-are-divisible-by-k
1786-count-the-number-of-consistent-strings
1848-sum-of-unique-elements
2190-count-common-words-with-one-occurrence
2356-largest-combination-with-bitwise-and-greater-than-zero
2494-sum-of-prefix-scores-of-strings

Two Pointers

0011-container-with-most-water
0019-remove-nth-node-from-end-of-list
0026-remove-duplicates-from-sorted-array
0028-find-the-index-of-the-first-occurrence-in-a-string
0042-trapping-rain-water
0061-rotate-list
0080-remove-duplicates-from-sorted-array-ii
0082-remove-duplicates-from-sorted-list-ii
0088-merge-sorted-array
0125-valid-palindrome
0151-reverse-words-in-a-string
0160-intersection-of-two-linked-lists
0189-rotate-array
0234-palindrome-linked-list
0349-intersection-of-two-arrays
0392-is-subsequence
0567-permutation-in-string
1019-squares-of-a-sorted-array
1798-max-number-of-k-sum-pairs
1894-merge-strings-alternately
1923-sentence-similarity-iii
2095-minimum-number-of-swaps-to-make-the-string-balanced
2236-maximum-twin-sum-of-a-linked-list
2488-divide-intervals-into-minimum-number-of-groups
2551-apply-operations-to-an-array
2581-divide-players-into-teams-of-equal-skill
2699-count-the-number-of-fair-pairs
3195-separate-black-and-white-balls

Simulation

0067-add-binary
0906-walking-robot-simulation
1667-find-kth-bit-in-nth-binary-string
2006-find-the-student-that-will-replace-the-chalk
2076-sum-of-digits-of-string-after-convert
2132-convert-1d-array-into-2d-array
2155-find-missing-observations
2411-spiral-matrix-iv
2470-removing-stars-from-a-string
2551-apply-operations-to-an-array
2800-minimum-string-length-after-removing-substrings

Matrix

0048-rotate-image
0074-search-a-2d-matrix
0240-search-a-2d-matrix-ii
0419-battleships-in-a-board
2015-determine-whether-matrix-can-be-obtained-by-rotation
2132-convert-1d-array-into-2d-array
2411-spiral-matrix-iv
2675-find-the-width-of-columns-of-a-grid

Math

0013-roman-to-integer
0029-divide-two-integers
0048-rotate-image
0066-plus-one
0067-add-binary
0189-rotate-array
0241-different-ways-to-add-parentheses
0292-nim-game
0367-valid-perfect-square
0380-insert-delete-getrandom-o1
0381-insert-delete-getrandom-o1-duplicates-allowed
0400-nth-digit
0453-minimum-moves-to-equal-array-elements
0539-minimum-time-difference
0670-maximum-swap
0873-guess-the-word
1879-maximum-score-from-removing-stones
1920-determine-color-of-a-chessboard-square
2155-find-missing-observations
2423-minimum-deletions-to-make-array-divisible
2903-insert-greatest-common-divisors-in-linked-list
3553-check-if-two-chessboard-squares-have-the-same-color

Binary Search

0004-median-of-two-sorted-arrays
0033-search-in-rotated-sorted-array
0034-find-first-and-last-position-of-element-in-sorted-array
0035-search-insert-position
0074-search-a-2d-matrix
0081-search-in-rotated-sorted-array-ii
0153-find-minimum-in-rotated-sorted-array
0162-find-peak-element
0209-minimum-size-subarray-sum
0240-search-a-2d-matrix-ii
0349-intersection-of-two-arrays
0367-valid-perfect-square
0400-nth-digit
0729-my-calendar-i
0731-my-calendar-ii
2006-find-the-student-that-will-replace-the-chalk
2179-most-beautiful-item-for-each-query
2188-minimized-maximum-of-products-distributed-to-any-store
2699-count-the-number-of-fair-pairs

Prefix Sum

0209-minimum-size-subarray-sum
0238-product-of-array-except-self
0731-my-calendar-ii
1435-xor-queries-of-a-subarray
1473-find-the-longest-substring-containing-vowels-in-even-counts
1694-make-sum-divisible-by-p
1940-maximum-xor-for-each-query
2006-find-the-student-that-will-replace-the-chalk
2488-divide-intervals-into-minimum-number-of-groups

Depth-First Search

0094-binary-tree-inorder-traversal
0098-validate-binary-search-tree
0100-same-tree
0104-maximum-depth-of-binary-tree
0110-balanced-binary-tree
0111-minimum-depth-of-binary-tree
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0386-lexicographical-numbers
0419-battleships-in-a-board
0988-flip-equivalent-binary-trees
1350-remove-sub-folders-from-the-filesystem
1484-linked-list-in-binary-tree
2677-cousins-in-binary-tree-ii

String

0003-longest-substring-without-repeating-characters
0006-zigzag-conversion
0008-string-to-integer-atoi
0013-roman-to-integer
0014-longest-common-prefix
0020-valid-parentheses
0028-find-the-index-of-the-first-occurrence-in-a-string
0058-length-of-last-word
0067-add-binary
0125-valid-palindrome
0151-reverse-words-in-a-string
0179-largest-number
0205-isomorphic-strings
0214-shortest-palindrome
0241-different-ways-to-add-parentheses
0242-valid-anagram
0290-word-pattern
0383-ransom-note
0387-first-unique-character-in-a-string
0392-is-subsequence
0438-find-all-anagrams-in-a-string
0459-repeated-substring-pattern
0539-minimum-time-difference
0567-permutation-in-string
0812-rotate-string
0822-unique-morse-code-words
0873-guess-the-word
0920-uncommon-words-from-two-sentences
0957-minimum-add-to-make-parentheses-valid
1128-remove-all-adjacent-duplicates-in-string
1197-parsing-a-boolean-expression
1302-delete-characters-to-make-fancy-string
1304-longest-happy-string
1350-remove-sub-folders-from-the-filesystem
1473-find-the-longest-substring-containing-vowels-in-even-counts
1667-find-kth-bit-in-nth-binary-string
1715-split-a-string-into-the-max-number-of-unique-substrings
1786-count-the-number-of-consistent-strings
1894-merge-strings-alternately
1899-count-items-matching-a-rule
1920-determine-color-of-a-chessboard-square
1923-sentence-similarity-iii
2076-sum-of-digits-of-string-after-convert
2095-minimum-number-of-swaps-to-make-the-string-balanced
2190-count-common-words-with-one-occurrence
2470-removing-stars-from-a-string
2494-sum-of-prefix-scores-of-strings
2580-circular-sentence
2755-extra-characters-in-a-string
2800-minimum-string-length-after-removing-substrings
2825-minimize-string-length
3174-minimum-number-of-changes-to-make-binary-string-beautiful
3195-separate-black-and-white-balls
3329-find-the-length-of-the-longest-common-prefix
3451-string-compression-iii
3553-check-if-two-chessboard-squares-have-the-same-color

Brainteaser

0292-nim-game
2503-longest-subarray-with-maximum-bitwise-and

Game Theory

0292-nim-game
0873-guess-the-word

Linked List

0019-remove-nth-node-from-end-of-list
0023-merge-k-sorted-lists
0061-rotate-list
0082-remove-duplicates-from-sorted-list-ii
0160-intersection-of-two-linked-lists
0234-palindrome-linked-list
0237-delete-node-in-a-linked-list
0432-all-oone-data-structure
0725-split-linked-list-in-parts
0859-design-circular-deque
0860-design-circular-queue
1484-linked-list-in-binary-tree
2236-maximum-twin-sum-of-a-linked-list
2411-spiral-matrix-iv
2573-remove-nodes-from-linked-list
2903-insert-greatest-common-divisors-in-linked-list
3501-delete-nodes-from-linked-list-present-in-array

Stack

0020-valid-parentheses
0042-trapping-rain-water
0094-binary-tree-inorder-traversal
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0234-palindrome-linked-list
0496-next-greater-element-i
0739-daily-temperatures
0957-minimum-add-to-make-parentheses-valid
1002-maximum-width-ramp
1128-remove-all-adjacent-duplicates-in-string
1197-parsing-a-boolean-expression
1497-design-a-stack-with-increment-operation
2095-minimum-number-of-swaps-to-make-the-string-balanced
2236-maximum-twin-sum-of-a-linked-list
2470-removing-stars-from-a-string
2573-remove-nodes-from-linked-list
2800-minimum-string-length-after-removing-substrings

Recursion

0234-palindrome-linked-list
0241-different-ways-to-add-parentheses
1197-parsing-a-boolean-expression
1667-find-kth-bit-in-nth-binary-string
2573-remove-nodes-from-linked-list

Monotonic Stack

0042-trapping-rain-water
0496-next-greater-element-i
0739-daily-temperatures
1002-maximum-width-ramp
2573-remove-nodes-from-linked-list

Sorting

0088-merge-sorted-array
0169-majority-element
0179-largest-number
0217-contains-duplicate
0242-valid-anagram
0274-h-index
0349-intersection-of-two-arrays
0539-minimum-time-difference
0632-smallest-range-covering-elements-from-k-lists
1019-squares-of-a-sorted-array
1256-rank-transform-of-an-array
1798-max-number-of-k-sum-pairs
2179-most-beautiful-item-for-each-query
2412-minimum-amount-of-time-to-fill-cups
2423-minimum-deletions-to-make-array-divisible
2488-divide-intervals-into-minimum-number-of-groups
2581-divide-players-into-teams-of-equal-skill
2646-kth-largest-sum-in-a-binary-tree
2699-count-the-number-of-fair-pairs
3291-find-if-array-can-be-sorted

Database

0175-combine-two-tables
0181-employees-earning-more-than-their-managers
0197-rising-temperature
0577-employee-bonus
1153-product-sales-analysis-i
1509-replace-employee-id-with-the-unique-identifier
1664-find-users-with-valid-e-mails
1724-customer-who-visited-but-did-not-make-any-transactions
1801-average-time-of-process-per-machine

Divide and Conquer

0004-median-of-two-sorted-arrays
0023-merge-k-sorted-lists
0169-majority-element
0190-reverse-bits
0191-number-of-1-bits
0240-search-a-2d-matrix-ii

Tree

0094-binary-tree-inorder-traversal
0098-validate-binary-search-tree
0100-same-tree
0104-maximum-depth-of-binary-tree
0110-balanced-binary-tree
0111-minimum-depth-of-binary-tree
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0988-flip-equivalent-binary-trees
1484-linked-list-in-binary-tree
2646-kth-largest-sum-in-a-binary-tree
2677-cousins-in-binary-tree-ii

Breadth-First Search

0100-same-tree
0104-maximum-depth-of-binary-tree
0111-minimum-depth-of-binary-tree
1484-linked-list-in-binary-tree
2646-kth-largest-sum-in-a-binary-tree
2677-cousins-in-binary-tree-ii

Binary Tree

0094-binary-tree-inorder-traversal
0098-validate-binary-search-tree
0100-same-tree
0104-maximum-depth-of-binary-tree
0110-balanced-binary-tree
0111-minimum-depth-of-binary-tree
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0988-flip-equivalent-binary-trees
1484-linked-list-in-binary-tree
2646-kth-largest-sum-in-a-binary-tree
2677-cousins-in-binary-tree-ii

Sliding Window

0003-longest-substring-without-repeating-characters
0209-minimum-size-subarray-sum
0219-contains-duplicate-ii
0438-find-all-anagrams-in-a-string
0567-permutation-in-string
0632-smallest-range-covering-elements-from-k-lists
3380-shortest-subarray-with-or-at-least-k-ii

Heap (Priority Queue)

0023-merge-k-sorted-lists
0632-smallest-range-covering-elements-from-k-lists
1127-last-stone-weight
1304-longest-happy-string
1879-maximum-score-from-removing-stones
2054-the-number-of-the-smallest-unoccupied-chair
2412-minimum-amount-of-time-to-fill-cups
2423-minimum-deletions-to-make-array-divisible
2488-divide-intervals-into-minimum-number-of-groups
2616-maximal-score-after-applying-k-operations

Number Theory

2423-minimum-deletions-to-make-array-divisible
2903-insert-greatest-common-divisors-in-linked-list

Greedy

0011-container-with-most-water
0045-jump-game-ii
0055-jump-game
0122-best-time-to-buy-and-sell-stock-ii
0179-largest-number
0632-smallest-range-covering-elements-from-k-lists
0670-maximum-swap
0957-minimum-add-to-make-parentheses-valid
1304-longest-happy-string
1879-maximum-score-from-removing-stones
2095-minimum-number-of-swaps-to-make-the-string-balanced
2412-minimum-amount-of-time-to-fill-cups
2488-divide-intervals-into-minimum-number-of-groups
2616-maximal-score-after-applying-k-operations
3195-separate-black-and-white-balls

Bit Manipulation

0029-divide-two-integers
0067-add-binary
0190-reverse-bits
0191-number-of-1-bits
0338-counting-bits
1435-xor-queries-of-a-subarray
1441-minimum-flips-to-make-a-or-b-equal-to-c
1473-find-the-longest-substring-containing-vowels-in-even-counts
1786-count-the-number-of-consistent-strings
1940-maximum-xor-for-each-query
2170-count-number-of-maximum-bitwise-or-subsets
2323-minimum-bit-flips-to-convert-number
2356-largest-combination-with-bitwise-and-greater-than-zero
2503-longest-subarray-with-maximum-bitwise-and
3249-minimum-number-of-operations-to-make-array-xor-equal-to-k
3291-find-if-array-can-be-sorted
3380-shortest-subarray-with-or-at-least-k-ii
3394-minimum-array-end

Binary Search Tree

0098-validate-binary-search-tree

Trie

0014-longest-common-prefix
0386-lexicographical-numbers
0440-k-th-smallest-in-lexicographical-order
1350-remove-sub-folders-from-the-filesystem
2494-sum-of-prefix-scores-of-strings
2755-extra-characters-in-a-string
3329-find-the-length-of-the-longest-common-prefix

Dynamic Programming

0042-trapping-rain-water
0045-jump-game-ii
0055-jump-game
0118-pascals-triangle
0119-pascals-triangle-ii
0121-best-time-to-buy-and-sell-stock
0122-best-time-to-buy-and-sell-stock-ii
0241-different-ways-to-add-parentheses
0338-counting-bits
0392-is-subsequence
2755-extra-characters-in-a-string

Memoization

0241-different-ways-to-add-parentheses

Rolling Hash

0214-shortest-palindrome

String Matching

0028-find-the-index-of-the-first-occurrence-in-a-string
0214-shortest-palindrome
0459-repeated-substring-pattern
0812-rotate-string

Hash Function

0214-shortest-palindrome

Interactive

0873-guess-the-word

Design

0380-insert-delete-getrandom-o1
0381-insert-delete-getrandom-o1-duplicates-allowed
0432-all-oone-data-structure
0729-my-calendar-i
0731-my-calendar-ii
0859-design-circular-deque
0860-design-circular-queue
1497-design-a-stack-with-increment-operation

Segment Tree

0729-my-calendar-i
0731-my-calendar-ii

Ordered Set

0729-my-calendar-i
0731-my-calendar-ii

Queue

0387-first-unique-character-in-a-string
0859-design-circular-deque
0860-design-circular-queue

Doubly-Linked List

0432-all-oone-data-structure

Randomized

0380-insert-delete-getrandom-o1
0381-insert-delete-getrandom-o1-duplicates-allowed

Counting Sort

0274-h-index

Backtracking

1715-split-a-string-into-the-max-number-of-unique-substrings
2170-count-number-of-maximum-bitwise-or-subsets

Enumeration

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

Merge Sort

0023-merge-k-sorted-lists

About

A collection of LeetCode questions to ace the coding interview! - Created using [LeetHub v2](https://github.com/arunbhardwaj/LeetHub-2.0)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published