Skip to content

Vivekchavda1374/Leetcode-coding

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

734 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Leetcode

LeetCode Topics

Array

0001-two-sum
0004-median-of-two-sorted-arrays
0011-container-with-most-water
0015-3sum
0018-4sum
0027-remove-element
0031-next-permutation
0036-valid-sudoku
0039-combination-sum
0040-combination-sum-ii
0042-trapping-rain-water
0048-rotate-image
0049-group-anagrams
0056-merge-intervals
0059-spiral-matrix-ii
0063-unique-paths-ii
0064-minimum-path-sum
0074-search-a-2d-matrix
0075-sort-colors
0079-word-search
0118-pascals-triangle
0119-pascals-triangle-ii
0121-best-time-to-buy-and-sell-stock
0123-best-time-to-buy-and-sell-stock-iii
0189-rotate-array
0198-house-robber
0213-house-robber-ii
0238-product-of-array-except-self
0239-sliding-window-maximum
0240-search-a-2d-matrix-ii
0300-longest-increasing-subsequence
0303-range-sum-query-immutable
0304-range-sum-query-2d-immutable
0309-best-time-to-buy-and-sell-stock-with-cooldown
0312-burst-balloons
0322-coin-change
0354-russian-doll-envelopes
0403-frog-jump
0493-reverse-pairs
0498-diagonal-traverse
0518-coin-change-ii
0540-single-element-in-a-sorted-array
0560-subarray-sum-equals-k
0679-24-game
0741-cherry-pickup
0745-find-smallest-letter-greater-than-target
0882-peak-index-in-a-mountain-array
0898-transpose-matrix
0940-fruit-into-baskets
0952-word-subsets
1006-vowel-spellchecker
1016-subarray-sums-divisible-by-k
1206-corporate-flight-bookings
1231-replace-elements-with-greatest-element-on-right-side
1396-count-servers-that-communicate
1402-count-square-submatrices-with-all-ones
1524-string-matching-in-an-array
1586-longest-subarray-of-1s-after-deleting-one-element
1603-running-sum-of-1d-array
1628-count-submatrices-with-all-ones
1635-number-of-good-pairs
1805-minimum-adjacent-swaps-for-k-consecutive-ones
1876-map-of-highest-peak
1895-minimum-number-of-operations-to-move-all-balls-to-each-box
1917-maximum-average-pass-ratio
2006-find-the-student-that-will-replace-the-chalk
2058-concatenation-of-array
2145-grid-game
2229-maximum-fruits-harvested-after-at-most-k-steps
2292-counting-words-with-a-given-prefix
2358-number-of-ways-to-split-array
2432-number-of-zero-filled-subarrays
2465-shifting-letters-ii
2473-max-sum-of-a-pair-with-equal-sum-of-digits
2529-range-product-queries-of-powers
2533-bitwise-xor-of-all-pairings
2614-maximum-count-of-positive-integer-and-negative-integer
2685-first-completely-painted-row-or-column
2689-rearranging-fruits
2691-count-vowel-strings-in-ranges
2714-left-and-right-sum-differences
2766-find-the-prefix-common-array-of-two-arrays
2792-neighboring-bitwise-xor
3227-find-missing-and-repeated-values
3309-count-prefix-and-suffix-pairs-i
3461-find-the-minimum-area-to-cover-all-ones-i
3648-find-the-maximum-number-of-fruits-collected
3733-length-of-longest-v-shaped-diagonal-segment
3748-sort-matrix-by-diagonals
3790-fruits-into-baskets-ii
3791-fruits-into-baskets-iii

String

0003-longest-substring-without-repeating-characters
0010-regular-expression-matching
0049-group-anagrams
0076-minimum-window-substring
0079-word-search
0131-palindrome-partitioning
0383-ransom-note
0387-first-unique-character-in-a-string
0389-find-the-difference
0395-longest-substring-with-at-least-k-repeating-characters
0443-string-compression
0516-longest-palindromic-subsequence
0567-permutation-in-string
0778-reorganize-string
0952-word-subsets
1006-vowel-spellchecker
1502-construct-k-palindrome-strings
1508-longest-happy-prefix
1524-string-matching-in-an-array
1537-maximum-score-after-splitting-a-string
1895-minimum-number-of-operations-to-move-all-balls-to-each-box
2021-remove-all-occurrences-of-a-substring
2221-check-if-a-parentheses-string-can-be-valid
2292-counting-words-with-a-given-prefix
2346-largest-3-same-digit-number-in-string
2465-shifting-letters-ii
2691-count-vowel-strings-in-ranges
2887-sort-vowels-in-a-string
3309-count-prefix-and-suffix-pairs-i
3455-minimum-length-of-string-after-operations
3502-count-substrings-with-k-frequency-characters-i
3872-find-most-frequent-vowel-and-consonant

Prefix Sum

0238-product-of-array-except-self
0303-range-sum-query-immutable
0304-range-sum-query-2d-immutable
0560-subarray-sum-equals-k
1016-subarray-sums-divisible-by-k
1206-corporate-flight-bookings
1537-maximum-score-after-splitting-a-string
1603-running-sum-of-1d-array
1805-minimum-adjacent-swaps-for-k-consecutive-ones
1895-minimum-number-of-operations-to-move-all-balls-to-each-box
2006-find-the-student-that-will-replace-the-chalk
2145-grid-game
2229-maximum-fruits-harvested-after-at-most-k-steps
2358-number-of-ways-to-split-array
2465-shifting-letters-ii
2529-range-product-queries-of-powers
2691-count-vowel-strings-in-ranges
2714-left-and-right-sum-differences

Binary Search

0004-median-of-two-sorted-arrays
0074-search-a-2d-matrix
0222-count-complete-tree-nodes
0240-search-a-2d-matrix-ii
0300-longest-increasing-subsequence
0354-russian-doll-envelopes
0493-reverse-pairs
0540-single-element-in-a-sorted-array
0745-find-smallest-letter-greater-than-target
0882-peak-index-in-a-mountain-array
2006-find-the-student-that-will-replace-the-chalk
2229-maximum-fruits-harvested-after-at-most-k-steps
2614-maximum-count-of-positive-integer-and-negative-integer
3790-fruits-into-baskets-ii
3791-fruits-into-baskets-iii

Bit Manipulation

0029-divide-two-integers
0089-gray-code
0190-reverse-bits
0222-count-complete-tree-nodes
0342-power-of-four
0389-find-the-difference
1444-number-of-steps-to-reduce-a-number-to-zero
2509-minimize-xor
2529-range-product-queries-of-powers
2533-bitwise-xor-of-all-pairings
2766-find-the-prefix-common-array-of-two-arrays
2792-neighboring-bitwise-xor

Tree

0095-unique-binary-search-trees-ii
0096-unique-binary-search-trees
0222-count-complete-tree-nodes
0235-lowest-common-ancestor-of-a-binary-search-tree
0543-diameter-of-binary-tree
1492-time-needed-to-inform-all-employees
2461-amount-of-time-for-binary-tree-to-be-infected

Binary Tree

0095-unique-binary-search-trees-ii
0096-unique-binary-search-trees
0222-count-complete-tree-nodes
0235-lowest-common-ancestor-of-a-binary-search-tree
0543-diameter-of-binary-tree
2461-amount-of-time-for-binary-tree-to-be-infected

Dynamic Programming

0010-regular-expression-matching
0042-trapping-rain-water
0062-unique-paths
0063-unique-paths-ii
0064-minimum-path-sum
0070-climbing-stairs
0095-unique-binary-search-trees-ii
0096-unique-binary-search-trees
0118-pascals-triangle
0119-pascals-triangle-ii
0121-best-time-to-buy-and-sell-stock
0123-best-time-to-buy-and-sell-stock-iii
0131-palindrome-partitioning
0198-house-robber
0213-house-robber-ii
0279-perfect-squares
0300-longest-increasing-subsequence
0309-best-time-to-buy-and-sell-stock-with-cooldown
0312-burst-balloons
0322-coin-change
0354-russian-doll-envelopes
0403-frog-jump
0516-longest-palindromic-subsequence
0518-coin-change-ii
0741-cherry-pickup
0867-new-21-game
1013-fibonacci-number
1402-count-square-submatrices-with-all-ones
1586-longest-subarray-of-1s-after-deleting-one-element
1628-count-submatrices-with-all-ones
2882-ways-to-express-an-integer-as-sum-of-powers
3648-find-the-maximum-number-of-fruits-collected
3733-length-of-longest-v-shaped-diagonal-segment

Breadth-First Search

0279-perfect-squares
0322-coin-change
1396-count-servers-that-communicate
1492-time-needed-to-inform-all-employees
1876-map-of-highest-peak
2461-amount-of-time-for-binary-tree-to-be-infected

String Matching

1508-longest-happy-prefix
1524-string-matching-in-an-array
2292-counting-words-with-a-given-prefix
3309-count-prefix-and-suffix-pairs-i

Trie

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

Rolling Hash

1508-longest-happy-prefix
3309-count-prefix-and-suffix-pairs-i

Hash Function

1508-longest-happy-prefix
3309-count-prefix-and-suffix-pairs-i

Hash Table

0001-two-sum
0003-longest-substring-without-repeating-characters
0036-valid-sudoku
0049-group-anagrams
0076-minimum-window-substring
0138-copy-list-with-random-pointer
0142-linked-list-cycle-ii
0146-lru-cache
0383-ransom-note
0387-first-unique-character-in-a-string
0389-find-the-difference
0395-longest-substring-with-at-least-k-repeating-characters
0560-subarray-sum-equals-k
0567-permutation-in-string
0778-reorganize-string
0900-reordered-power-of-2
0940-fruit-into-baskets
0952-word-subsets
1006-vowel-spellchecker
1016-subarray-sums-divisible-by-k
1502-construct-k-palindrome-strings
1635-number-of-good-pairs
2461-amount-of-time-for-binary-tree-to-be-infected
2473-max-sum-of-a-pair-with-equal-sum-of-digits
2685-first-completely-painted-row-or-column
2689-rearranging-fruits
2766-find-the-prefix-common-array-of-two-arrays
3227-find-missing-and-repeated-values
3455-minimum-length-of-string-after-operations
3502-count-substrings-with-k-frequency-characters-i
3872-find-most-frequent-vowel-and-consonant

Greedy

0011-container-with-most-water
0778-reorganize-string
1448-maximum-69-number
1502-construct-k-palindrome-strings
1805-minimum-adjacent-swaps-for-k-consecutive-ones
1917-maximum-average-pass-ratio
2221-check-if-a-parentheses-string-can-be-valid
2509-minimize-xor
2689-rearranging-fruits

Counting

0383-ransom-note
0387-first-unique-character-in-a-string
0778-reorganize-string
0900-reordered-power-of-2
1396-count-servers-that-communicate
1502-construct-k-palindrome-strings
1635-number-of-good-pairs
2614-maximum-count-of-positive-integer-and-negative-integer
3455-minimum-length-of-string-after-operations
3872-find-most-frequent-vowel-and-consonant

Database

0175-combine-two-tables
0197-rising-temperature
0584-find-customer-referee
0595-big-countries
1174-sales-analysis-iii
1258-article-views-i
1509-replace-employee-id-with-the-unique-identifier
1724-customer-who-visited-but-did-not-make-any-transactions
1827-invalid-tweets
1908-recyclable-and-low-fat-products

Divide and Conquer

0004-median-of-two-sorted-arrays
0190-reverse-bits
0240-search-a-2d-matrix-ii
0395-longest-substring-with-at-least-k-repeating-characters
0493-reverse-pairs

Sorting

0015-3sum
0018-4sum
0049-group-anagrams
0056-merge-intervals
0075-sort-colors
0354-russian-doll-envelopes
0389-find-the-difference
0778-reorganize-string
0900-reordered-power-of-2
2473-max-sum-of-a-pair-with-equal-sum-of-digits
2689-rearranging-fruits
2887-sort-vowels-in-a-string
3748-sort-matrix-by-diagonals

Stack

0042-trapping-rain-water
0225-implement-stack-using-queues
0234-palindrome-linked-list
1628-count-submatrices-with-all-ones
2021-remove-all-occurrences-of-a-substring
2221-check-if-a-parentheses-string-can-be-valid

Brainteaser

0319-bulb-switcher
2533-bitwise-xor-of-all-pairings

Math

0002-add-two-numbers
0007-reverse-integer
0029-divide-two-integers
0048-rotate-image
0050-powx-n
0062-unique-paths
0070-climbing-stairs
0089-gray-code
0096-unique-binary-search-trees
0189-rotate-array
0279-perfect-squares
0319-bulb-switcher
0326-power-of-three
0342-power-of-four
0679-24-game
0867-new-21-game
0900-reordered-power-of-2
1013-fibonacci-number
1444-number-of-steps-to-reduce-a-number-to-zero
1448-maximum-69-number
1630-count-odd-numbers-in-an-interval-range
1635-number-of-good-pairs
2432-number-of-zero-filled-subarrays
2491-smallest-even-multiple
2630-alternating-digit-sum
3227-find-missing-and-repeated-values
3830-find-closest-person

Matrix

0036-valid-sudoku
0048-rotate-image
0059-spiral-matrix-ii
0063-unique-paths-ii
0064-minimum-path-sum
0074-search-a-2d-matrix
0079-word-search
0240-search-a-2d-matrix-ii
0304-range-sum-query-2d-immutable
0498-diagonal-traverse
0741-cherry-pickup
0898-transpose-matrix
1396-count-servers-that-communicate
1402-count-square-submatrices-with-all-ones
1628-count-submatrices-with-all-ones
1876-map-of-highest-peak
2145-grid-game
2685-first-completely-painted-row-or-column
3227-find-missing-and-repeated-values
3461-find-the-minimum-area-to-cover-all-ones-i
3648-find-the-maximum-number-of-fruits-collected
3733-length-of-longest-v-shaped-diagonal-segment
3748-sort-matrix-by-diagonals

Depth-First Search

0079-word-search
0235-lowest-common-ancestor-of-a-binary-search-tree
0543-diameter-of-binary-tree
0766-flatten-a-multilevel-doubly-linked-list
1396-count-servers-that-communicate
1492-time-needed-to-inform-all-employees
2461-amount-of-time-for-binary-tree-to-be-infected

Union Find

1396-count-servers-that-communicate

Simulation

0059-spiral-matrix-ii
0498-diagonal-traverse
0898-transpose-matrix
2006-find-the-student-that-will-replace-the-chalk
2021-remove-all-occurrences-of-a-substring
2058-concatenation-of-array
3790-fruits-into-baskets-ii

Design

0146-lru-cache
0225-implement-stack-using-queues
0303-range-sum-query-immutable
0304-range-sum-query-2d-immutable

Heap (Priority Queue)

0239-sliding-window-maximum
0778-reorganize-string
1917-maximum-average-pass-ratio
2473-max-sum-of-a-pair-with-equal-sum-of-digits

Queue

0225-implement-stack-using-queues
0239-sliding-window-maximum
0387-first-unique-character-in-a-string

Two Pointers

0011-container-with-most-water
0015-3sum
0018-4sum
0027-remove-element
0031-next-permutation
0042-trapping-rain-water
0075-sort-colors
0142-linked-list-cycle-ii
0189-rotate-array
0234-palindrome-linked-list
0443-string-compression
0567-permutation-in-string

Number Theory

2491-smallest-even-multiple

Recursion

0002-add-two-numbers
0010-regular-expression-matching
0025-reverse-nodes-in-k-group
0050-powx-n
0234-palindrome-linked-list
0326-power-of-three
0342-power-of-four
1013-fibonacci-number

Concurrency

1203-print-in-order

Memoization

0070-climbing-stairs
1013-fibonacci-number
3733-length-of-longest-v-shaped-diagonal-segment

Combinatorics

0062-unique-paths

Binary Search Tree

0095-unique-binary-search-trees-ii
0096-unique-binary-search-trees
0235-lowest-common-ancestor-of-a-binary-search-tree

Backtracking

0039-combination-sum
0040-combination-sum-ii
0079-word-search
0089-gray-code
0095-unique-binary-search-trees-ii
0131-palindrome-partitioning
0679-24-game

Sliding Window

0003-longest-substring-without-repeating-characters
0076-minimum-window-substring
0239-sliding-window-maximum
0395-longest-substring-with-at-least-k-repeating-characters
0567-permutation-in-string
0867-new-21-game
0940-fruit-into-baskets
1586-longest-subarray-of-1s-after-deleting-one-element
1805-minimum-adjacent-swaps-for-k-consecutive-ones
2229-maximum-fruits-harvested-after-at-most-k-steps
3502-count-substrings-with-k-frequency-characters-i

Segment Tree

0493-reverse-pairs
3790-fruits-into-baskets-ii
3791-fruits-into-baskets-iii

Ordered Set

0493-reverse-pairs
3790-fruits-into-baskets-ii
3791-fruits-into-baskets-iii

Enumeration

0900-reordered-power-of-2

Probability and Statistics

0867-new-21-game

Monotonic Stack

0042-trapping-rain-water
1628-count-submatrices-with-all-ones

Monotonic Queue

0239-sliding-window-maximum

Linked List

0002-add-two-numbers
0025-reverse-nodes-in-k-group
0092-reverse-linked-list-ii
0138-copy-list-with-random-pointer
0142-linked-list-cycle-ii
0146-lru-cache
0234-palindrome-linked-list
0766-flatten-a-multilevel-doubly-linked-list

Doubly-Linked List

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

Binary Indexed Tree

0493-reverse-pairs

Merge Sort

0493-reverse-pairs

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

 
 
 

Contributors

Languages