Skip to content

Collection of LeetCode questions to ace the coding interview!

Notifications You must be signed in to change notification settings

vaibhavbichave/Leetcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divamazon-divdiv-classcompanytagscontainer-tagoccurence32-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divfacebook-divdiv-classcompanytagscontainer-tagoccurence18-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divmicrosoft-divdiv-classcompanytagscontainer-tagoccurence15-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divasana-divdiv-classcompanytagscontainer-tagoccurence13-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divapple-divdiv-classcompanytagscontainer-tagoccurence10-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divuber-divdiv-classcompanytagscontainer-tagoccurence8-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divadobe-divdiv-classcompanytagscontainer-tagoccurence7-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divbloomberg-divdiv-classcompanytagscontainer-tagoccurence4-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divoracle-divdiv-classcompanytagscontainer-tagoccurence4-div-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div238-product-of-array-except-self
0div-idbig-omega-company-tagsdiv-idbig-omega-topbardiv-classcompanytagscontainer-styleoverflow-x-scroll-flex-wrap-nowrap-div-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divamazon-divdiv-classcompanytagscontainer-tagoccurence32-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divfacebook-divdiv-classcompanytagscontainer-tagoccurence18-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divmicrosoft-divdiv-classcompanytagscontainer-tagoccurence15-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divasana-divdiv-classcompanytagscontainer-tagoccurence13-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divapple-divdiv-classcompanytagscontainer-tagoccurence10-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divuber-divdiv-classcompanytagscontainer-tagoccurence8-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divadobe-divdiv-classcompanytagscontainer-tagoccurence7-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divbloomberg-divdiv-classcompanytagscontainer-tagoccurence4-div-divdiv-classcompanytagscontainer-tag-stylebackground-color-rgba0-10-32-005-divoracle-divdiv-classcompanytagscontainer-tagoccurence4-div-div-divdiv-classcompanytagscontainer-chevrondivsvg-version11-idicon-xmlnshttp-wwww3org-2000-svg-xmlns-xlinkhttp-wwww3org-1999-xlink-x0px-y0px-viewbox0-0-32-32-fill4087f1-xml-spacepreserve-stylewidth-20px-polygon-points16-22-6-12-74-106-16-192-246-106-26-12-polygonrect-id-x3c-transparent-rectangle-x3e-classst0-fillnone-width32-height32-rect-svg-div-div-div-div238-product-of-array-except-self
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leetcode

Collection of LeetCode questions to ace the coding interview! - Created using LeetHub

Array

0330-patching-array
0502-ipo

Greedy

0330-patching-array
0502-ipo

Sorting

0502-ipo

Heap (Priority Queue)

0023-merge-k-sorted-lists
0502-ipo

Linked List

0002-add-two-numbers
0019-remove-nth-node-from-end-of-list
0021-merge-two-sorted-lists
0023-merge-k-sorted-lists
0024-swap-nodes-in-pairs
0061-rotate-list
0082-remove-duplicates-from-sorted-list-ii
0083-remove-duplicates-from-sorted-list

Math

0002-add-two-numbers

Recursion

0002-add-two-numbers
0021-merge-two-sorted-lists
0024-swap-nodes-in-pairs

Two Pointers

0019-remove-nth-node-from-end-of-list
0061-rotate-list
0082-remove-duplicates-from-sorted-list-ii

Divide and Conquer

0023-merge-k-sorted-lists

Merge Sort

0023-merge-k-sorted-lists

LeetCode Topics

Array

0215-kth-largest-element-in-an-array
0373-find-k-pairs-with-smallest-sums
0378-kth-smallest-element-in-a-sorted-matrix
0393-utf-8-validation
0494-target-sum
0503-next-greater-element-ii
0901-advantage-shuffle
1025-minimum-cost-for-tickets
1063-best-sightseeing-pair
1207-delete-nodes-and-return-forest
1293-three-consecutive-odds
1333-sort-the-jumbled-numbers
1496-lucky-numbers-in-a-matrix
1524-string-matching-in-an-array
1538-maximum-points-you-can-obtain-from-cards
1556-make-two-arrays-equal-by-reversing-subarrays
1616-minimum-difference-between-largest-and-smallest-value-in-three-moves
1679-shortest-subarray-to-be-removed-to-make-array-sorted
1711-find-valid-matrix-given-row-and-column-sums
1720-crawler-log-folder
1741-sort-array-by-increasing-frequency
1755-defuse-the-bomb
1886-minimum-limit-of-balls-in-a-bag
1895-minimum-number-of-operations-to-move-all-balls-to-each-box
1951-find-the-winner-of-the-circular-game
1972-rotating-the-box
1975-minimum-distance-to-the-target-element
2022-maximum-alternating-subsequence-sum
2089-maximum-matrix-sum
2163-kth-distinct-string-in-an-array
2188-minimized-maximum-of-products-distributed-to-any-store
2232-adding-spaces-to-a-string
2292-counting-words-with-a-given-prefix
2306-create-binary-tree-from-descriptions
2358-number-of-ways-to-split-array
2421-maximum-number-of-pairs-in-array
2472-build-a-matrix-with-conditions
2473-max-sum-of-a-pair-with-equal-sum-of-digits
2476-check-distances-between-same-letters
2502-sort-the-people
2552-maximum-sum-of-distinct-subarrays-with-length-k
2585-delete-greatest-value-in-each-row
2631-sort-the-students-by-their-kth-score
2691-count-vowel-strings-in-ranges
2868-continuous-subarrays
3165-find-indices-with-index-and-value-difference-i
3170-find-indices-with-index-and-value-difference-ii
3176-minimum-sum-of-mountain-triplets-i
3186-minimum-sum-of-mountain-triplets-ii
3269-number-of-subarrays-that-match-a-pattern-i
3309-count-prefix-and-suffix-pairs-i
3335-minimum-operations-to-write-the-letter-y-on-a-grid

Math

1307-ugly-number-iii
1515-find-the-minimum-number-of-fibonacci-numbers-whose-sum-is-k
1885-count-number-of-homogenous-substrings
1951-find-the-winner-of-the-circular-game
2630-alternating-digit-sum
2650-split-with-minimum-sum
3275-minimum-number-of-pushes-to-type-word-i

Recursion

1951-find-the-winner-of-the-circular-game

Queue

0225-implement-stack-using-queues
1951-find-the-winner-of-the-circular-game
2868-continuous-subarrays

Simulation

1951-find-the-winner-of-the-circular-game
2232-adding-spaces-to-a-string
2585-delete-greatest-value-in-each-row

String

0778-reorganize-string
0812-rotate-string
1298-reverse-substrings-between-each-pair-of-parentheses
1520-number-of-steps-to-reduce-a-number-in-binary-representation-to-one
1524-string-matching-in-an-array
1537-maximum-score-after-splitting-a-string
1720-crawler-log-folder
1818-maximum-score-from-removing-substrings
1885-count-number-of-homogenous-substrings
1890-sum-of-beauty-of-all-substrings
1895-minimum-number-of-operations-to-move-all-balls-to-each-box
2163-kth-distinct-string-in-an-array
2217-step-by-step-directions-from-a-binary-tree-node-to-another
2232-adding-spaces-to-a-string
2292-counting-words-with-a-given-prefix
2476-check-distances-between-same-letters
2502-sort-the-people
2691-count-vowel-strings-in-ranges
3018-make-string-a-subsequence-using-cyclic-increments
3275-minimum-number-of-pushes-to-type-word-i
3276-minimum-number-of-pushes-to-type-word-ii
3309-count-prefix-and-suffix-pairs-i
3405-count-the-number-of-special-characters-ii
3408-count-the-number-of-special-characters-i

Tree

0515-find-largest-value-in-each-tree-row
0789-kth-largest-element-in-a-stream
1207-delete-nodes-and-return-forest
1653-number-of-good-leaf-nodes-pairs
2217-step-by-step-directions-from-a-binary-tree-node-to-another
2306-create-binary-tree-from-descriptions
2493-reverse-odd-levels-of-binary-tree
2558-minimum-number-of-operations-to-sort-a-binary-tree-by-level

Depth-First Search

0207-course-schedule
0515-find-largest-value-in-each-tree-row
1207-delete-nodes-and-return-forest
1653-number-of-good-leaf-nodes-pairs
2217-step-by-step-directions-from-a-binary-tree-node-to-another
2493-reverse-odd-levels-of-binary-tree

Binary Tree

0515-find-largest-value-in-each-tree-row
0789-kth-largest-element-in-a-stream
1207-delete-nodes-and-return-forest
1653-number-of-good-leaf-nodes-pairs
2217-step-by-step-directions-from-a-binary-tree-node-to-another
2306-create-binary-tree-from-descriptions
2493-reverse-odd-levels-of-binary-tree
2558-minimum-number-of-operations-to-sort-a-binary-tree-by-level

Greedy

0778-reorganize-string
0901-advantage-shuffle
1515-find-the-minimum-number-of-fibonacci-numbers-whose-sum-is-k
1616-minimum-difference-between-largest-and-smallest-value-in-three-moves
1711-find-valid-matrix-given-row-and-column-sums
1818-maximum-score-from-removing-substrings
2089-maximum-matrix-sum
2188-minimized-maximum-of-products-distributed-to-any-store
2650-split-with-minimum-sum
3275-minimum-number-of-pushes-to-type-word-i
3276-minimum-number-of-pushes-to-type-word-ii

Sorting

0215-kth-largest-element-in-an-array
0378-kth-smallest-element-in-a-sorted-matrix
0778-reorganize-string
0901-advantage-shuffle
1333-sort-the-jumbled-numbers
1556-make-two-arrays-equal-by-reversing-subarrays
1616-minimum-difference-between-largest-and-smallest-value-in-three-moves
1741-sort-array-by-increasing-frequency
2473-max-sum-of-a-pair-with-equal-sum-of-digits
2502-sort-the-people
2585-delete-greatest-value-in-each-row
2631-sort-the-students-by-their-kth-score
2650-split-with-minimum-sum
3276-minimum-number-of-pushes-to-type-word-ii

Hash Table

0778-reorganize-string
0931-maximum-frequency-stack
1207-delete-nodes-and-return-forest
1556-make-two-arrays-equal-by-reversing-subarrays
1741-sort-array-by-increasing-frequency
1890-sum-of-beauty-of-all-substrings
2163-kth-distinct-string-in-an-array
2306-create-binary-tree-from-descriptions
2421-maximum-number-of-pairs-in-array
2473-max-sum-of-a-pair-with-equal-sum-of-digits
2476-check-distances-between-same-letters
2502-sort-the-people
2552-maximum-sum-of-distinct-subarrays-with-length-k
3276-minimum-number-of-pushes-to-type-word-ii
3335-minimum-operations-to-write-the-letter-y-on-a-grid
3405-count-the-number-of-special-characters-ii
3408-count-the-number-of-special-characters-i

Dynamic Programming

0494-target-sum
1025-minimum-cost-for-tickets
1063-best-sightseeing-pair
2022-maximum-alternating-subsequence-sum

Matrix

0378-kth-smallest-element-in-a-sorted-matrix
1496-lucky-numbers-in-a-matrix
1711-find-valid-matrix-given-row-and-column-sums
1972-rotating-the-box
2089-maximum-matrix-sum
2472-build-a-matrix-with-conditions
2585-delete-greatest-value-in-each-row
2631-sort-the-students-by-their-kth-score
3335-minimum-operations-to-write-the-letter-y-on-a-grid

Graph

0207-course-schedule
2472-build-a-matrix-with-conditions

Topological Sort

0207-course-schedule
2472-build-a-matrix-with-conditions

Stack

0225-implement-stack-using-queues
0503-next-greater-element-ii
0931-maximum-frequency-stack
1298-reverse-substrings-between-each-pair-of-parentheses
1679-shortest-subarray-to-be-removed-to-make-array-sorted
1720-crawler-log-folder
1818-maximum-score-from-removing-substrings

Binary Search

0378-kth-smallest-element-in-a-sorted-matrix
1307-ugly-number-iii
1679-shortest-subarray-to-be-removed-to-make-array-sorted
1886-minimum-limit-of-balls-in-a-bag
2188-minimized-maximum-of-products-distributed-to-any-store

Combinatorics

1307-ugly-number-iii

Number Theory

1307-ugly-number-iii

Counting

0778-reorganize-string
1890-sum-of-beauty-of-all-substrings
2163-kth-distinct-string-in-an-array
2421-maximum-number-of-pairs-in-array
3276-minimum-number-of-pushes-to-type-word-ii
3335-minimum-operations-to-write-the-letter-y-on-a-grid

Two Pointers

0901-advantage-shuffle
1679-shortest-subarray-to-be-removed-to-make-array-sorted
1972-rotating-the-box
2232-adding-spaces-to-a-string
3018-make-string-a-subsequence-using-cyclic-increments
3165-find-indices-with-index-and-value-difference-i
3170-find-indices-with-index-and-value-difference-ii

Rolling Hash

3269-number-of-subarrays-that-match-a-pattern-i
3309-count-prefix-and-suffix-pairs-i

String Matching

0812-rotate-string
1524-string-matching-in-an-array
2292-counting-words-with-a-given-prefix
3269-number-of-subarrays-that-match-a-pattern-i
3309-count-prefix-and-suffix-pairs-i

Hash Function

3269-number-of-subarrays-that-match-a-pattern-i
3309-count-prefix-and-suffix-pairs-i

Design

0225-implement-stack-using-queues
0789-kth-largest-element-in-a-stream
0931-maximum-frequency-stack
1955-seat-reservation-manager

Breadth-First Search

0207-course-schedule
0515-find-largest-value-in-each-tree-row
2493-reverse-odd-levels-of-binary-tree
2558-minimum-number-of-operations-to-sort-a-binary-tree-by-level

Binary Search Tree

0789-kth-largest-element-in-a-stream

Heap (Priority Queue)

0023-merge-k-sorted-lists
0215-kth-largest-element-in-an-array
0373-find-k-pairs-with-smallest-sums
0378-kth-smallest-element-in-a-sorted-matrix
0778-reorganize-string
0789-kth-largest-element-in-a-stream
1955-seat-reservation-manager
2473-max-sum-of-a-pair-with-equal-sum-of-digits
2585-delete-greatest-value-in-each-row
2868-continuous-subarrays

Data Stream

0789-kth-largest-element-in-a-stream

Database

0596-classes-more-than-5-students

Sliding Window

1538-maximum-points-you-can-obtain-from-cards
1755-defuse-the-bomb
2552-maximum-sum-of-distinct-subarrays-with-length-k
2868-continuous-subarrays

Prefix Sum

1537-maximum-score-after-splitting-a-string
1538-maximum-points-you-can-obtain-from-cards
1895-minimum-number-of-operations-to-move-all-balls-to-each-box
2358-number-of-ways-to-split-array
2691-count-vowel-strings-in-ranges

Ordered Set

0931-maximum-frequency-stack
2868-continuous-subarrays

Monotonic Queue

2868-continuous-subarrays

Monotonic Stack

0503-next-greater-element-ii
1679-shortest-subarray-to-be-removed-to-make-array-sorted

Backtracking

0494-target-sum

Bit Manipulation

0393-utf-8-validation
1520-number-of-steps-to-reduce-a-number-in-binary-representation-to-one

Divide and Conquer

0023-merge-k-sorted-lists
0215-kth-largest-element-in-an-array

Quickselect

0215-kth-largest-element-in-an-array

Linked List

0023-merge-k-sorted-lists

Merge Sort

0023-merge-k-sorted-lists

Trie

3309-count-prefix-and-suffix-pairs-i

About

Collection of LeetCode questions to ace the coding interview!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages