Skip to content

WebDev-Ayush/LC2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LC2

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

LeetCode Topics

Two Pointers

0005-longest-palindromic-substring
0015-3sum
0016-3sum-closest
0018-4sum
0028-find-the-index-of-the-first-occurrence-in-a-string
0031-next-permutation
0086-partition-list
0455-assign-cookies
0475-heaters
0827-expressive-words
0841-shortest-distance-to-a-character
2551-apply-operations-to-an-array
2707-merge-two-2d-arrays-by-summing-values

String

0003-longest-substring-without-repeating-characters
0005-longest-palindromic-substring
0006-zigzag-conversion
0008-string-to-integer-atoi
0010-regular-expression-matching
0012-integer-to-roman
0017-letter-combinations-of-a-phone-number
0022-generate-parentheses
0028-find-the-index-of-the-first-occurrence-in-a-string
0030-substring-with-concatenation-of-all-words
0032-longest-valid-parentheses
0038-count-and-say
0043-multiply-strings
0049-group-anagrams
0139-word-break
0140-word-break-ii
0166-fraction-to-recurring-decimal
0472-concatenated-words
0474-ones-and-zeroes
0822-unique-morse-code-words
0824-number-of-lines-to-write-string
0827-expressive-words
0829-subdomain-visit-count
0837-most-common-word
0839-short-encoding-of-words
0841-shortest-distance-to-a-character
0851-goat-latin
0857-positions-of-large-groups
1006-vowel-spellchecker
1058-lexicographically-smallest-equivalent-string
1160-letter-tile-possibilities
1170-shortest-common-supersequence
1264-maximum-number-of-words-you-can-type
1460-number-of-substrings-containing-all-three-characters
1516-the-k-th-lexicographical-string-of-all-happy-strings-of-length-n
1636-number-of-substrings-with-only-1s
1915-check-if-one-string-swap-can-make-strings-equal
2021-remove-all-occurrences-of-a-substring
2107-find-unique-binary-string
2140-longest-subsequence-repeated-k-times
2211-count-collisions-on-a-road
2237-longest-palindrome-by-concatenating-two-letter-words
2260-divide-a-string-into-groups-of-size-k
2395-longest-binary-subsequence-less-than-or-equal-to-k
2456-construct-smallest-number-from-di-string
2463-minimum-recolors-to-get-k-consecutive-black-blocks
2887-sort-vowels-in-a-string
3194-find-words-containing-character
3462-vowels-game-in-a-string
3797-design-spreadsheet

String Matching

0028-find-the-index-of-the-first-occurrence-in-a-string

Depth-First Search

0094-binary-tree-inorder-traversal
0130-surrounded-regions
0463-island-perimeter
0472-concatenated-words
0684-redundant-connection
0854-making-a-large-island
1218-lowest-common-ancestor-of-deepest-leaves
1387-find-elements-in-a-contaminated-binary-tree
1558-course-schedule-iv
2564-most-profitable-path-in-a-tree
2764-maximum-number-of-fish-in-a-grid
3633-maximize-the-number-of-target-nodes-after-connecting-trees-i
3645-maximize-the-number-of-target-nodes-after-connecting-trees-ii

Breadth-First Search

0130-surrounded-regions
0463-island-perimeter
0684-redundant-connection
0854-making-a-large-island
1218-lowest-common-ancestor-of-deepest-leaves
1387-find-elements-in-a-contaminated-binary-tree
1424-maximum-candies-you-can-get-from-boxes
1558-course-schedule-iv
2564-most-profitable-path-in-a-tree
2764-maximum-number-of-fish-in-a-grid
3633-maximize-the-number-of-target-nodes-after-connecting-trees-i
3645-maximize-the-number-of-target-nodes-after-connecting-trees-ii

Graph

0684-redundant-connection
1424-maximum-candies-you-can-get-from-boxes
1558-course-schedule-iv
2564-most-profitable-path-in-a-tree

Topological Sort

1558-course-schedule-iv

Array

0015-3sum
0016-3sum-closest
0018-4sum
0031-next-permutation
0033-search-in-rotated-sorted-array
0034-find-first-and-last-position-of-element-in-sorted-array
0036-valid-sudoku
0039-combination-sum
0040-combination-sum-ii
0045-jump-game-ii
0046-permutations
0047-permutations-ii
0048-rotate-image
0049-group-anagrams
0051-n-queens
0053-maximum-subarray
0054-spiral-matrix
0055-jump-game
0056-merge-intervals
0057-insert-interval
0090-subsets-ii
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0106-construct-binary-tree-from-inorder-and-postorder-traversal
0108-convert-sorted-array-to-binary-search-tree
0118-pascals-triangle
0119-pascals-triangle-ii
0120-triangle
0121-best-time-to-buy-and-sell-stock
0122-best-time-to-buy-and-sell-stock-ii
0123-best-time-to-buy-and-sell-stock-iii
0128-longest-consecutive-sequence
0130-surrounded-regions
0134-gas-station
0135-candy
0136-single-number
0137-single-number-ii
0139-word-break
0140-word-break-ii
0149-max-points-on-a-line
0150-evaluate-reverse-polish-notation
0152-maximum-product-subarray
0153-find-minimum-in-rotated-sorted-array
0154-find-minimum-in-rotated-sorted-array-ii
0446-arithmetic-slices-ii-subsequence
0447-number-of-boomerangs
0448-find-all-numbers-disappeared-in-an-array
0453-minimum-moves-to-equal-array-elements
0454-4sum-ii
0455-assign-cookies
0456-132-pattern
0462-minimum-moves-to-equal-array-elements-ii
0463-island-perimeter
0472-concatenated-words
0473-matchsticks-to-square
0474-ones-and-zeroes
0475-heaters
0477-total-hamming-distance
0594-longest-harmonious-subsequence
0797-rabbits-in-forest
0822-unique-morse-code-words
0824-number-of-lines-to-write-string
0827-expressive-words
0829-subdomain-visit-count
0830-largest-triangle-area
0837-most-common-word
0839-short-encoding-of-words
0841-shortest-distance-to-a-character
0854-making-a-large-island
0905-length-of-longest-fibonacci-subsequence
0925-construct-binary-tree-from-preorder-and-postorder-traversal
1006-vowel-spellchecker
1364-tuple-with-same-product
1421-find-numbers-with-even-number-of-digits
1424-maximum-candies-you-can-get-from-boxes
1426-find-n-unique-integers-sum-up-to-zero
1631-number-of-sub-arrays-with-odd-sum
1819-construct-the-lexicographically-largest-valid-sequence
1834-minimum-number-of-people-to-teach
1849-maximum-absolute-sum-of-any-subarray
1927-maximum-ascending-subarray-sum
2107-find-unique-binary-string
2204-find-subsequence-of-length-k-with-the-largest-sum
2237-longest-palindrome-by-concatenating-two-letter-words
2307-replace-non-coprime-numbers-in-array
2432-number-of-zero-filled-subarrays
2551-apply-operations-to-an-array
2564-most-profitable-path-in-a-tree
2626-count-the-number-of-good-subarrays
2681-put-marbles-in-bags
2707-merge-two-2d-arrays-by-summing-values
2753-minimum-number-of-operations-to-make-all-array-elements-equal-to-1
2764-maximum-number-of-fish-in-a-grid
2915-count-of-interesting-subarrays
3194-find-words-containing-character
3227-find-missing-and-repeated-values
3242-count-elements-with-maximum-frequency
3332-minimum-operations-to-exceed-threshold-value-ii
3429-special-array-i
3434-find-the-number-of-distinct-colors-among-the-balls
3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i
3483-alternating-groups-ii
3610-find-x-sum-of-all-k-long-subarrays-i
3616-make-array-elements-equal-to-zero
3656-minimum-number-of-operations-to-make-elements-in-array-distinct
3744-minimum-operations-to-make-array-elements-zero
3789-maximize-subarrays-after-removing-one-conflicting-pair
3797-design-spreadsheet

Union Find

0128-longest-consecutive-sequence
0130-surrounded-regions
0684-redundant-connection
0854-making-a-large-island
1058-lexicographically-smallest-equivalent-string
2764-maximum-number-of-fish-in-a-grid

Matrix

0036-valid-sudoku
0048-rotate-image
0054-spiral-matrix
0130-surrounded-regions
0463-island-perimeter
0854-making-a-large-island
2764-maximum-number-of-fish-in-a-grid
3227-find-missing-and-repeated-values
3797-design-spreadsheet

Hash Table

0003-longest-substring-without-repeating-characters
0012-integer-to-roman
0017-letter-combinations-of-a-phone-number
0030-substring-with-concatenation-of-all-words
0036-valid-sudoku
0049-group-anagrams
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0106-construct-binary-tree-from-inorder-and-postorder-traversal
0128-longest-consecutive-sequence
0139-word-break
0140-word-break-ii
0149-max-points-on-a-line
0166-fraction-to-recurring-decimal
0447-number-of-boomerangs
0448-find-all-numbers-disappeared-in-an-array
0454-4sum-ii
0594-longest-harmonious-subsequence
0797-rabbits-in-forest
0822-unique-morse-code-words
0829-subdomain-visit-count
0837-most-common-word
0839-short-encoding-of-words
0900-reordered-power-of-2
0905-length-of-longest-fibonacci-subsequence
0925-construct-binary-tree-from-preorder-and-postorder-traversal
1006-vowel-spellchecker
1160-letter-tile-possibilities
1218-lowest-common-ancestor-of-deepest-leaves
1264-maximum-number-of-words-you-can-type
1364-tuple-with-same-product
1387-find-elements-in-a-contaminated-binary-tree
1460-number-of-substrings-containing-all-three-characters
1834-minimum-number-of-people-to-teach
1915-check-if-one-string-swap-can-make-strings-equal
2107-find-unique-binary-string
2204-find-subsequence-of-length-k-with-the-largest-sum
2237-longest-palindrome-by-concatenating-two-letter-words
2626-count-the-number-of-good-subarrays
2707-merge-two-2d-arrays-by-summing-values
2915-count-of-interesting-subarrays
3227-find-missing-and-repeated-values
3242-count-elements-with-maximum-frequency
3434-find-the-number-of-distinct-colors-among-the-balls
3610-find-x-sum-of-all-k-long-subarrays-i
3656-minimum-number-of-operations-to-make-elements-in-array-distinct
3797-design-spreadsheet

Counting

0594-longest-harmonious-subsequence
0829-subdomain-visit-count
0837-most-common-word
0900-reordered-power-of-2
1160-letter-tile-possibilities
1364-tuple-with-same-product
1915-check-if-one-string-swap-can-make-strings-equal
2140-longest-subsequence-repeated-k-times
2237-longest-palindrome-by-concatenating-two-letter-words
3242-count-elements-with-maximum-frequency

Simulation

0043-multiply-strings
0054-spiral-matrix
2021-remove-all-occurrences-of-a-substring
2211-count-collisions-on-a-road
2260-divide-a-string-into-groups-of-size-k
2408-number-of-people-aware-of-a-secret
2551-apply-operations-to-an-array
3332-minimum-operations-to-exceed-threshold-value-ii
3434-find-the-number-of-distinct-colors-among-the-balls
3616-make-array-elements-equal-to-zero

Stack

0032-longest-valid-parentheses
0094-binary-tree-inorder-traversal
0150-evaluate-reverse-polish-notation
0456-132-pattern
2021-remove-all-occurrences-of-a-substring
2211-count-collisions-on-a-road
2307-replace-non-coprime-numbers-in-array
2456-construct-smallest-number-from-di-string

Heap (Priority Queue)

0023-merge-k-sorted-lists
2204-find-subsequence-of-length-k-with-the-largest-sum
2681-put-marbles-in-bags
3332-minimum-operations-to-exceed-threshold-value-ii
3610-find-x-sum-of-all-k-long-subarrays-i

Math

0002-add-two-numbers
0007-reverse-integer
0012-integer-to-roman
0029-divide-two-integers
0043-multiply-strings
0048-rotate-image
0149-max-points-on-a-line
0150-evaluate-reverse-polish-notation
0166-fraction-to-recurring-decimal
0342-power-of-four
0447-number-of-boomerangs
0453-minimum-moves-to-equal-array-elements
0462-minimum-moves-to-equal-array-elements-ii
0477-total-hamming-distance
0797-rabbits-in-forest
0830-largest-triangle-area
0900-reordered-power-of-2
1421-find-numbers-with-even-number-of-digits
1426-find-n-unique-integers-sum-up-to-zero
1440-convert-integer-to-the-sum-of-two-no-zero-integers
1631-number-of-sub-arrays-with-odd-sum
1636-number-of-substrings-with-only-1s
1889-check-if-number-is-a-sum-of-powers-of-three
2307-replace-non-coprime-numbers-in-array
2415-count-the-number-of-ideal-arrays
2432-number-of-zero-filled-subarrays
2649-count-total-number-of-colored-cells
2753-minimum-number-of-operations-to-make-all-array-elements-equal-to-1
2802-find-the-punishment-number-of-an-integer
3227-find-missing-and-repeated-values
3462-vowels-game-in-a-string
3744-minimum-operations-to-make-array-elements-zero

Backtracking

0017-letter-combinations-of-a-phone-number
0022-generate-parentheses
0039-combination-sum
0040-combination-sum-ii
0046-permutations
0047-permutations-ii
0051-n-queens
0090-subsets-ii
0140-word-break-ii
0473-matchsticks-to-square
1160-letter-tile-possibilities
1516-the-k-th-lexicographical-string-of-all-happy-strings-of-length-n
1819-construct-the-lexicographically-largest-valid-sequence
2107-find-unique-binary-string
2140-longest-subsequence-repeated-k-times
2456-construct-smallest-number-from-di-string
2802-find-the-punishment-number-of-an-integer

Greedy

0045-jump-game-ii
0055-jump-game
0122-best-time-to-buy-and-sell-stock-ii
0134-gas-station
0135-candy
0455-assign-cookies
0797-rabbits-in-forest
1834-minimum-number-of-people-to-teach
2140-longest-subsequence-repeated-k-times
2237-longest-palindrome-by-concatenating-two-letter-words
2395-longest-binary-subsequence-less-than-or-equal-to-k
2456-construct-smallest-number-from-di-string
2681-put-marbles-in-bags

Tree

0094-binary-tree-inorder-traversal
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0106-construct-binary-tree-from-inorder-and-postorder-traversal
0108-convert-sorted-array-to-binary-search-tree
0925-construct-binary-tree-from-preorder-and-postorder-traversal
1218-lowest-common-ancestor-of-deepest-leaves
1387-find-elements-in-a-contaminated-binary-tree
2564-most-profitable-path-in-a-tree
3633-maximize-the-number-of-target-nodes-after-connecting-trees-i
3645-maximize-the-number-of-target-nodes-after-connecting-trees-ii

Design

1387-find-elements-in-a-contaminated-binary-tree
3797-design-spreadsheet

Binary Tree

0094-binary-tree-inorder-traversal
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0106-construct-binary-tree-from-inorder-and-postorder-traversal
0108-convert-sorted-array-to-binary-search-tree
0925-construct-binary-tree-from-preorder-and-postorder-traversal
1218-lowest-common-ancestor-of-deepest-leaves
1387-find-elements-in-a-contaminated-binary-tree

Divide and Conquer

0023-merge-k-sorted-lists
0053-maximum-subarray
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0106-construct-binary-tree-from-inorder-and-postorder-traversal
0108-convert-sorted-array-to-binary-search-tree
0925-construct-binary-tree-from-preorder-and-postorder-traversal

Linked List

0002-add-two-numbers
0021-merge-two-sorted-lists
0023-merge-k-sorted-lists
0024-swap-nodes-in-pairs
0025-reverse-nodes-in-k-group
0083-remove-duplicates-from-sorted-list
0086-partition-list

Recursion

0002-add-two-numbers
0010-regular-expression-matching
0021-merge-two-sorted-lists
0024-swap-nodes-in-pairs
0025-reverse-nodes-in-k-group
0342-power-of-four

Sliding Window

0003-longest-substring-without-repeating-characters
0030-substring-with-concatenation-of-all-words
0594-longest-harmonious-subsequence
1460-number-of-substrings-containing-all-three-characters
2463-minimum-recolors-to-get-k-consecutive-black-blocks
2626-count-the-number-of-good-subarrays
3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i
3483-alternating-groups-ii
3610-find-x-sum-of-all-k-long-subarrays-i

Dynamic Programming

0005-longest-palindromic-substring
0010-regular-expression-matching
0022-generate-parentheses
0032-longest-valid-parentheses
0045-jump-game-ii
0053-maximum-subarray
0055-jump-game
0118-pascals-triangle
0119-pascals-triangle-ii
0120-triangle
0121-best-time-to-buy-and-sell-stock
0122-best-time-to-buy-and-sell-stock-ii
0123-best-time-to-buy-and-sell-stock-iii
0139-word-break
0140-word-break-ii
0152-maximum-product-subarray
0446-arithmetic-slices-ii-subsequence
0472-concatenated-words
0473-matchsticks-to-square
0474-ones-and-zeroes
0905-length-of-longest-fibonacci-subsequence
1170-shortest-common-supersequence
1631-number-of-sub-arrays-with-odd-sum
1849-maximum-absolute-sum-of-any-subarray
2395-longest-binary-subsequence-less-than-or-equal-to-k
2408-number-of-people-aware-of-a-secret
2415-count-the-number-of-ideal-arrays

Sorting

0015-3sum
0016-3sum-closest
0018-4sum
0047-permutations-ii
0049-group-anagrams
0056-merge-intervals
0455-assign-cookies
0462-minimum-moves-to-equal-array-elements-ii
0475-heaters
0594-longest-harmonious-subsequence
0900-reordered-power-of-2
2204-find-subsequence-of-length-k-with-the-largest-sum
2681-put-marbles-in-bags
2887-sort-vowels-in-a-string

Merge Sort

0023-merge-k-sorted-lists

Bit Manipulation

0029-divide-two-integers
0090-subsets-ii
0136-single-number
0137-single-number-ii
0342-power-of-four
0473-matchsticks-to-square
0477-total-hamming-distance
2837-minimum-operations-to-make-the-integer-zero
3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i
3744-minimum-operations-to-make-array-elements-zero

Binary Search

0033-search-in-rotated-sorted-array
0034-find-first-and-last-position-of-element-in-sorted-array
0153-find-minimum-in-rotated-sorted-array
0154-find-minimum-in-rotated-sorted-array-ii
0456-132-pattern
0475-heaters

Binary Search Tree

0108-convert-sorted-array-to-binary-search-tree

Prefix Sum

1631-number-of-sub-arrays-with-odd-sum
2915-count-of-interesting-subarrays
3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i
3616-make-array-elements-equal-to-zero
3789-maximize-subarrays-after-removing-one-conflicting-pair

Trie

0139-word-break
0140-word-break-ii
0472-concatenated-words
0839-short-encoding-of-words

Memoization

0139-word-break
0140-word-break-ii
2395-longest-binary-subsequence-less-than-or-equal-to-k

Geometry

0149-max-points-on-a-line
0830-largest-triangle-area

Monotonic Stack

0456-132-pattern

Ordered Set

0456-132-pattern

Bitmask

0473-matchsticks-to-square

Database

0180-consecutive-numbers
0197-rising-temperature
0570-managers-with-at-least-5-direct-reports
0577-employee-bonus
0596-classes-more-than-5-students
0610-triangle-judgement
0619-biggest-single-number
0620-not-boring-movies
1135-customers-who-bought-all-products
1153-product-sales-analysis-i
1155-product-sales-analysis-iii
1161-project-employees-i
1182-game-play-analysis-iv
1245-user-activity-for-the-past-30-days-i
1258-article-views-i
1278-product-price-at-a-given-date
1292-immediate-food-delivery-ii
1317-monthly-transactions-i
1327-last-person-to-fit-in-the-bus
1338-queries-quality-and-percentage
1390-average-selling-price
1509-replace-employee-id-with-the-unique-identifier
1724-customer-who-visited-but-did-not-make-any-transactions
1773-percentage-of-users-attended-a-contest
1801-average-time-of-process-per-machine
1827-invalid-tweets
1877-find-followers-count
1882-the-number-of-employees-which-report-to-each-employee
1942-primary-department-for-each-employee
2087-confirmation-rate
2495-number-of-unique-subjects-taught-by-each-teacher

Queue

2408-number-of-people-aware-of-a-secret
3475-minimum-operations-to-make-binary-array-elements-equal-to-one-i

Combinatorics

2415-count-the-number-of-ideal-arrays

Number Theory

2307-replace-non-coprime-numbers-in-array
2415-count-the-number-of-ideal-arrays
2753-minimum-number-of-operations-to-make-all-array-elements-equal-to-1

Enumeration

0900-reordered-power-of-2
2140-longest-subsequence-repeated-k-times
2837-minimum-operations-to-make-the-integer-zero
3789-maximize-subarrays-after-removing-one-conflicting-pair

Segment Tree

3789-maximize-subarrays-after-removing-one-conflicting-pair

Brainteaser

2837-minimum-operations-to-make-the-integer-zero
3462-vowels-game-in-a-string

Game Theory

3462-vowels-game-in-a-string

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