Skip to content

hari04204/Leetcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LINK TO LEETCODE PROFILE https://leetcode.com/hari04204/

LeetCode Topics

Array

0001-two-sum
0004-median-of-two-sorted-arrays
0011-container-with-most-water
0014-longest-common-prefix
0015-3sum
0031-next-permutation
0034-find-first-and-last-position-of-element-in-sorted-array
0036-valid-sudoku
0039-combination-sum
0042-trapping-rain-water
0045-jump-game-ii
0046-permutations
0049-group-anagrams
0053-maximum-subarray
0054-spiral-matrix
0055-jump-game
0056-merge-intervals
0066-plus-one
0078-subsets
0079-word-search
0084-largest-rectangle-in-histogram
0085-maximal-rectangle
0118-pascals-triangle
0120-triangle
0122-best-time-to-buy-and-sell-stock-ii
0128-longest-consecutive-sequence
0134-gas-station
0135-candy
0136-single-number
0150-evaluate-reverse-polish-notation
0152-maximum-product-subarray
0169-majority-element
0189-rotate-array
0200-number-of-islands
0204-count-primes
0213-house-robber-ii
0217-contains-duplicate
0221-maximal-square
0229-majority-element-ii
0238-product-of-array-except-self
0239-sliding-window-maximum
0283-move-zeroes
0300-longest-increasing-subsequence
0322-coin-change
0373-find-k-pairs-with-smallest-sums
0380-insert-delete-getrandom-o1
0403-frog-jump
0410-split-array-largest-sum
0436-find-right-interval
0448-find-all-numbers-disappeared-in-an-array
0456-132-pattern
0498-diagonal-traverse
0503-next-greater-element-ii
0518-coin-change-ii
0581-shortest-unsorted-continuous-subarray
0689-maximum-sum-of-3-non-overlapping-subarrays
0713-subarray-product-less-than-k
0905-length-of-longest-fibonacci-subsequence
0906-walking-robot-simulation
0917-boats-to-save-people
0925-construct-binary-tree-from-preorder-and-postorder-traversal
0940-fruit-into-baskets
0946-smallest-range-ii
0948-sort-an-array
0952-word-subsets
0967-minimum-falling-path-sum
1073-number-of-enclaves
1171-shortest-path-in-binary-matrix
1242-matrix-block-sum
1256-rank-transform-of-an-array
1342-queens-that-can-attack-the-king
1354-find-players-with-zero-or-one-losses
1402-count-square-submatrices-with-all-ones
1408-find-the-smallest-divisor-given-a-threshold
1428-jump-game-iii
1477-product-of-the-last-k-numbers
1528-kids-with-the-greatest-number-of-candies
1560-number-of-students-doing-homework-at-a-given-time
1575-maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts
1616-minimum-difference-between-largest-and-smallest-value-in-three-moves
1646-kth-missing-positive-number
1683-maximum-number-of-coins-you-can-get
1744-number-of-ways-to-form-a-target-string-given-a-dictionary
1819-construct-the-lexicographically-largest-valid-sequence
1833-find-the-highest-altitude
1843-number-of-rectangles-that-can-form-the-largest-square
1849-maximum-absolute-sum-of-any-subarray
1940-maximum-xor-for-each-query
1951-find-the-winner-of-the-circular-game
2038-nearest-exit-from-entrance-in-maze
2107-find-unique-binary-string
2116-count-number-of-pairs-with-absolute-difference-k
2145-grid-game
2160-minimum-operations-to-make-a-uni-value-grid
2204-find-subsequence-of-length-k-with-the-largest-sum
2229-maximum-fruits-harvested-after-at-most-k-steps
2262-solving-questions-with-brainpower
2265-partition-array-according-to-given-pivot
2271-rearrange-array-elements-by-sign
2308-divide-array-into-equal-pairs
2356-largest-combination-with-bitwise-and-greater-than-zero
2358-number-of-ways-to-split-array
2428-equal-row-and-column-pairs
2478-longest-nice-subarray
2564-most-profitable-path-in-a-tree
2586-longest-square-streak-in-an-array
2614-maximum-count-of-positive-integer-and-negative-integer
2616-maximal-score-after-applying-k-operations
2665-minimum-time-to-repair-cars
2685-first-completely-painted-row-or-column
2689-rearranging-fruits
2690-house-robber-iv
2691-count-vowel-strings-in-ranges
2707-merge-two-2d-arrays-by-summing-values
2794-maximum-number-of-moves-in-a-grid
3031-construct-product-matrix
3152-maximum-value-of-an-ordered-triplet-ii
3227-find-missing-and-repeated-values
3321-type-of-triangle
3332-minimum-operations-to-exceed-threshold-value-ii
3430-count-days-without-meetings
3657-check-if-grid-can-be-cut-into-sections
3790-fruits-into-baskets-ii

Hash Table

0001-two-sum
0003-longest-substring-without-repeating-characters
0017-letter-combinations-of-a-phone-number
0036-valid-sudoku
0049-group-anagrams
0128-longest-consecutive-sequence
0141-linked-list-cycle
0146-lru-cache
0160-intersection-of-two-linked-lists
0169-majority-element
0217-contains-duplicate
0229-majority-element-ii
0242-valid-anagram
0299-bulls-and-cows
0380-insert-delete-getrandom-o1
0424-longest-repeating-character-replacement
0448-find-all-numbers-disappeared-in-an-array
0451-sort-characters-by-frequency
0905-length-of-longest-fibonacci-subsequence
0906-walking-robot-simulation
0925-construct-binary-tree-from-preorder-and-postorder-traversal
0940-fruit-into-baskets
0952-word-subsets
1160-letter-tile-possibilities
1218-lowest-common-ancestor-of-deepest-leaves
1256-rank-transform-of-an-array
1297-maximum-number-of-balloons
1354-find-players-with-zero-or-one-losses
1387-find-elements-in-a-contaminated-binary-tree
2059-unique-length-3-palindromic-subsequences
2107-find-unique-binary-string
2116-count-number-of-pairs-with-absolute-difference-k
2204-find-subsequence-of-length-k-with-the-largest-sum
2308-divide-array-into-equal-pairs
2356-largest-combination-with-bitwise-and-greater-than-zero
2427-first-letter-to-appear-twice
2428-equal-row-and-column-pairs
2586-longest-square-streak-in-an-array
2685-first-completely-painted-row-or-column
2689-rearranging-fruits
2707-merge-two-2d-arrays-by-summing-values
3227-find-missing-and-repeated-values

Two Pointers

0005-longest-palindromic-substring
0011-container-with-most-water
0015-3sum
0031-next-permutation
0042-trapping-rain-water
0141-linked-list-cycle
0160-intersection-of-two-linked-lists
0189-rotate-array
0234-palindrome-linked-list
0283-move-zeroes
0557-reverse-words-in-a-string-iii
0581-shortest-unsorted-continuous-subarray
0917-boats-to-save-people
2265-partition-array-according-to-given-pivot
2271-rearrange-array-elements-by-sign
2572-append-characters-to-string-to-make-subsequence
2707-merge-two-2d-arrays-by-summing-values

Bit Manipulation

0078-subsets
0136-single-number
0231-power-of-two
1940-maximum-xor-for-each-query
2059-unique-length-3-palindromic-subsequences
2308-divide-array-into-equal-pairs
2356-largest-combination-with-bitwise-and-greater-than-zero
2427-first-letter-to-appear-twice
2478-longest-nice-subarray

Sorting

0015-3sum
0049-group-anagrams
0056-merge-intervals
0169-majority-element
0217-contains-duplicate
0229-majority-element-ii
0242-valid-anagram
0436-find-right-interval
0451-sort-characters-by-frequency
0581-shortest-unsorted-continuous-subarray
0917-boats-to-save-people
0946-smallest-range-ii
0948-sort-an-array
1256-rank-transform-of-an-array
1354-find-players-with-zero-or-one-losses
1575-maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts
1616-minimum-difference-between-largest-and-smallest-value-in-three-moves
1683-maximum-number-of-coins-you-can-get
2160-minimum-operations-to-make-a-uni-value-grid
2204-find-subsequence-of-length-k-with-the-largest-sum
2586-longest-square-streak-in-an-array
2689-rearranging-fruits
3321-type-of-triangle
3430-count-days-without-meetings
3657-check-if-grid-can-be-cut-into-sections

Divide and Conquer

0004-median-of-two-sorted-arrays
0053-maximum-subarray
0169-majority-element
0925-construct-binary-tree-from-preorder-and-postorder-traversal
0948-sort-an-array

Heap (Priority Queue)

0239-sliding-window-maximum
0373-find-k-pairs-with-smallest-sums
0451-sort-characters-by-frequency
0948-sort-an-array
1304-longest-happy-string
2204-find-subsequence-of-length-k-with-the-largest-sum
2616-maximal-score-after-applying-k-operations
3332-minimum-operations-to-exceed-threshold-value-ii

Merge Sort

0948-sort-an-array

Bucket Sort

0451-sort-characters-by-frequency
0948-sort-an-array

Radix Sort

0948-sort-an-array

Counting Sort

0169-majority-element
0229-majority-element-ii
0299-bulls-and-cows
0451-sort-characters-by-frequency
0948-sort-an-array
1160-letter-tile-possibilities
1297-maximum-number-of-balloons
1354-find-players-with-zero-or-one-losses
2116-count-number-of-pairs-with-absolute-difference-k
2308-divide-array-into-equal-pairs
2356-largest-combination-with-bitwise-and-greater-than-zero
2427-first-letter-to-appear-twice
2614-maximum-count-of-positive-integer-and-negative-integer

Math

0009-palindrome-number
0043-multiply-strings
0050-powx-n
0062-unique-paths
0066-plus-one
0070-climbing-stairs
0096-unique-binary-search-trees
0150-evaluate-reverse-polish-notation
0189-rotate-array
0204-count-primes
0231-power-of-two
0279-perfect-squares
0326-power-of-three
0343-integer-break
0380-insert-delete-getrandom-o1
0946-smallest-range-ii
1260-day-of-the-year
1295-minimum-garden-perimeter-to-collect-enough-apples
1477-product-of-the-last-k-numbers
1683-maximum-number-of-coins-you-can-get
1951-find-the-winner-of-the-circular-game
2160-minimum-operations-to-make-a-uni-value-grid
2610-closest-prime-numbers-in-range
2619-categorize-box-according-to-criteria
2649-count-total-number-of-colored-cells
3227-find-missing-and-repeated-values
3321-type-of-triangle

String

0003-longest-substring-without-repeating-characters
0005-longest-palindromic-substring
0014-longest-common-prefix
0017-letter-combinations-of-a-phone-number
0020-valid-parentheses
0022-generate-parentheses
0032-longest-valid-parentheses
0043-multiply-strings
0049-group-anagrams
0072-edit-distance
0079-word-search
0091-decode-ways
0097-interleaving-string
0242-valid-anagram
0299-bulls-and-cows
0424-longest-repeating-character-replacement
0451-sort-characters-by-frequency
0557-reverse-words-in-a-string-iii
0583-delete-operation-for-two-strings
0678-valid-parenthesis-string
0812-rotate-string
0952-word-subsets
1093-recover-a-tree-from-preorder-traversal
1160-letter-tile-possibilities
1170-shortest-common-supersequence
1260-day-of-the-year
1297-maximum-number-of-balloons
1302-delete-characters-to-make-fancy-string
1304-longest-happy-string
1516-the-k-th-lexicographical-string-of-all-happy-strings-of-length-n
1537-maximum-score-after-splitting-a-string
1744-number-of-ways-to-form-a-target-string-given-a-dictionary
2059-unique-length-3-palindromic-subsequences
2107-find-unique-binary-string
2427-first-letter-to-appear-twice
2456-construct-smallest-number-from-di-string
2572-append-characters-to-string-to-make-subsequence
2580-circular-sentence
2691-count-vowel-strings-in-ranges
3379-score-of-a-string
3617-find-the-original-typed-string-i
3618-find-the-original-typed-string-ii

Union Find

0128-longest-consecutive-sequence
0200-number-of-islands
1073-number-of-enclaves
2793-count-the-number-of-complete-components

Stack

0020-valid-parentheses
0032-longest-valid-parentheses
0042-trapping-rain-water
0084-largest-rectangle-in-histogram
0085-maximal-rectangle
0094-binary-tree-inorder-traversal
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0150-evaluate-reverse-polish-notation
0155-min-stack
0234-palindrome-linked-list
0456-132-pattern
0503-next-greater-element-ii
0581-shortest-unsorted-continuous-subarray
0678-valid-parenthesis-string
0775-n-ary-tree-preorder-traversal
2456-construct-smallest-number-from-di-string

Backtracking

0017-letter-combinations-of-a-phone-number
0022-generate-parentheses
0039-combination-sum
0046-permutations
0078-subsets
0079-word-search
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
2456-construct-smallest-number-from-di-string

Dynamic Programming

0005-longest-palindromic-substring
0022-generate-parentheses
0032-longest-valid-parentheses
0042-trapping-rain-water
0045-jump-game-ii
0053-maximum-subarray
0055-jump-game
0062-unique-paths
0070-climbing-stairs
0072-edit-distance
0085-maximal-rectangle
0091-decode-ways
0096-unique-binary-search-trees
0097-interleaving-string
0118-pascals-triangle
0120-triangle
0122-best-time-to-buy-and-sell-stock-ii
0124-binary-tree-maximum-path-sum
0152-maximum-product-subarray
0213-house-robber-ii
0221-maximal-square
0279-perfect-squares
0300-longest-increasing-subsequence
0322-coin-change
0343-integer-break
0403-frog-jump
0410-split-array-largest-sum
0518-coin-change-ii
0583-delete-operation-for-two-strings
0678-valid-parenthesis-string
0689-maximum-sum-of-3-non-overlapping-subarrays
0905-length-of-longest-fibonacci-subsequence
0967-minimum-falling-path-sum
1170-shortest-common-supersequence
1402-count-square-submatrices-with-all-ones
1744-number-of-ways-to-form-a-target-string-given-a-dictionary
1849-maximum-absolute-sum-of-any-subarray
2090-number-of-ways-to-arrive-at-destination
2262-solving-questions-with-brainpower
2562-count-ways-to-build-good-strings
2586-longest-square-streak-in-an-array
2794-maximum-number-of-moves-in-a-grid
3239-minimum-number-of-operations-to-make-x-and-y-equal
3618-find-the-original-typed-string-ii

Linked List

0021-merge-two-sorted-lists
0083-remove-duplicates-from-sorted-list
0141-linked-list-cycle
0146-lru-cache
0160-intersection-of-two-linked-lists
0234-palindrome-linked-list
0838-design-linked-list

Design

0146-lru-cache
0155-min-stack
0380-insert-delete-getrandom-o1
0838-design-linked-list
1387-find-elements-in-a-contaminated-binary-tree
1477-product-of-the-last-k-numbers

Randomized

0380-insert-delete-getrandom-o1

Tree

0094-binary-tree-inorder-traversal
0096-unique-binary-search-trees
0098-validate-binary-search-tree
0102-binary-tree-level-order-traversal
0103-binary-tree-zigzag-level-order-traversal
0124-binary-tree-maximum-path-sum
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0199-binary-tree-right-side-view
0235-lowest-common-ancestor-of-a-binary-search-tree
0764-n-ary-tree-level-order-traversal
0775-n-ary-tree-preorder-traversal
0925-construct-binary-tree-from-preorder-and-postorder-traversal
1093-recover-a-tree-from-preorder-traversal
1218-lowest-common-ancestor-of-deepest-leaves
1387-find-elements-in-a-contaminated-binary-tree
1544-count-good-nodes-in-binary-tree
2564-most-profitable-path-in-a-tree

Depth-First Search

0094-binary-tree-inorder-traversal
0098-validate-binary-search-tree
0124-binary-tree-maximum-path-sum
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0199-binary-tree-right-side-view
0200-number-of-islands
0207-course-schedule
0235-lowest-common-ancestor-of-a-binary-search-tree
0775-n-ary-tree-preorder-traversal
1073-number-of-enclaves
1093-recover-a-tree-from-preorder-traversal
1218-lowest-common-ancestor-of-deepest-leaves
1387-find-elements-in-a-contaminated-binary-tree
1428-jump-game-iii
1544-count-good-nodes-in-binary-tree
2564-most-profitable-path-in-a-tree
2793-count-the-number-of-complete-components

Binary Tree

0094-binary-tree-inorder-traversal
0096-unique-binary-search-trees
0098-validate-binary-search-tree
0102-binary-tree-level-order-traversal
0103-binary-tree-zigzag-level-order-traversal
0124-binary-tree-maximum-path-sum
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0199-binary-tree-right-side-view
0235-lowest-common-ancestor-of-a-binary-search-tree
0925-construct-binary-tree-from-preorder-and-postorder-traversal
1093-recover-a-tree-from-preorder-traversal
1218-lowest-common-ancestor-of-deepest-leaves
1387-find-elements-in-a-contaminated-binary-tree
1544-count-good-nodes-in-binary-tree

Binary Search

0004-median-of-two-sorted-arrays
0034-find-first-and-last-position-of-element-in-sorted-array
0300-longest-increasing-subsequence
0410-split-array-largest-sum
0436-find-right-interval
0456-132-pattern
0713-subarray-product-less-than-k
1295-minimum-garden-perimeter-to-collect-enough-apples
1408-find-the-smallest-divisor-given-a-threshold
1646-kth-missing-positive-number
2229-maximum-fruits-harvested-after-at-most-k-steps
2586-longest-square-streak-in-an-array
2614-maximum-count-of-positive-integer-and-negative-integer
2665-minimum-time-to-repair-cars
2690-house-robber-iv
3790-fruits-into-baskets-ii

Simulation

0043-multiply-strings
0054-spiral-matrix
0498-diagonal-traverse
0906-walking-robot-simulation
1342-queens-that-can-attack-the-king
1951-find-the-winner-of-the-circular-game
2265-partition-array-according-to-given-pivot
2271-rearrange-array-elements-by-sign
2428-equal-row-and-column-pairs
3332-minimum-operations-to-exceed-threshold-value-ii
3790-fruits-into-baskets-ii

Matrix

0036-valid-sudoku
0054-spiral-matrix
0079-word-search
0085-maximal-rectangle
0200-number-of-islands
0221-maximal-square
0498-diagonal-traverse
0967-minimum-falling-path-sum
1073-number-of-enclaves
1171-shortest-path-in-binary-matrix
1242-matrix-block-sum
1342-queens-that-can-attack-the-king
1402-count-square-submatrices-with-all-ones
2038-nearest-exit-from-entrance-in-maze
2145-grid-game
2160-minimum-operations-to-make-a-uni-value-grid
2428-equal-row-and-column-pairs
2685-first-completely-painted-row-or-column
2794-maximum-number-of-moves-in-a-grid
3031-construct-product-matrix
3227-find-missing-and-repeated-values

Greedy

0011-container-with-most-water
0045-jump-game-ii
0055-jump-game
0122-best-time-to-buy-and-sell-stock-ii
0134-gas-station
0135-candy
0410-split-array-largest-sum
0581-shortest-unsorted-continuous-subarray
0678-valid-parenthesis-string
0917-boats-to-save-people
0946-smallest-range-ii
1304-longest-happy-string
1575-maximum-area-of-a-piece-of-cake-after-horizontal-and-vertical-cuts
1616-minimum-difference-between-largest-and-smallest-value-in-three-moves
1683-maximum-number-of-coins-you-can-get
2456-construct-smallest-number-from-di-string
2572-append-characters-to-string-to-make-subsequence
2616-maximal-score-after-applying-k-operations
2689-rearranging-fruits

Monotonic Stack

0042-trapping-rain-water
0084-largest-rectangle-in-histogram
0085-maximal-rectangle
0456-132-pattern
0503-next-greater-element-ii
0581-shortest-unsorted-continuous-subarray

Breadth-First Search

0102-binary-tree-level-order-traversal
0103-binary-tree-zigzag-level-order-traversal
0199-binary-tree-right-side-view
0200-number-of-islands
0207-course-schedule
0279-perfect-squares
0322-coin-change
0764-n-ary-tree-level-order-traversal
1073-number-of-enclaves
1171-shortest-path-in-binary-matrix
1218-lowest-common-ancestor-of-deepest-leaves
1387-find-elements-in-a-contaminated-binary-tree
1428-jump-game-iii
1544-count-good-nodes-in-binary-tree
2038-nearest-exit-from-entrance-in-maze
2564-most-profitable-path-in-a-tree
2793-count-the-number-of-complete-components
3239-minimum-number-of-operations-to-make-x-and-y-equal

Binary Search Tree

0096-unique-binary-search-trees
0098-validate-binary-search-tree
0235-lowest-common-ancestor-of-a-binary-search-tree

String Matching

0812-rotate-string

Prefix Sum

0238-product-of-array-except-self
0410-split-array-largest-sum
0713-subarray-product-less-than-k
1242-matrix-block-sum
1477-product-of-the-last-k-numbers
1537-maximum-score-after-splitting-a-string
1833-find-the-highest-altitude
1940-maximum-xor-for-each-query
2059-unique-length-3-palindromic-subsequences
2145-grid-game
2229-maximum-fruits-harvested-after-at-most-k-steps
2358-number-of-ways-to-split-array
2691-count-vowel-strings-in-ranges
3031-construct-product-matrix
3618-find-the-original-typed-string-ii

Data Stream

1477-product-of-the-last-k-numbers

Graph

0207-course-schedule
2090-number-of-ways-to-arrive-at-destination
2564-most-profitable-path-in-a-tree
2793-count-the-number-of-complete-components

Number Theory

0204-count-primes
2610-closest-prime-numbers-in-range

Sliding Window

0003-longest-substring-without-repeating-characters
0239-sliding-window-maximum
0424-longest-repeating-character-replacement
0713-subarray-product-less-than-k
0940-fruit-into-baskets
2229-maximum-fruits-harvested-after-at-most-k-steps
2478-longest-nice-subarray

Topological Sort

0207-course-schedule
2090-number-of-ways-to-arrive-at-destination

Shortest Path

2090-number-of-ways-to-arrive-at-destination

Recursion

0021-merge-two-sorted-lists
0050-powx-n
0231-power-of-two
0234-palindrome-linked-list
0326-power-of-three
1951-find-the-winner-of-the-circular-game

Queue

0239-sliding-window-maximum
1951-find-the-winner-of-the-circular-game

Enumeration

0204-count-primes

Game Theory

1683-maximum-number-of-coins-you-can-get

Ordered Set

0456-132-pattern
3790-fruits-into-baskets-ii

Database

0175-combine-two-tables
0584-find-customer-referee
0595-big-countries
1258-article-views-i
1827-invalid-tweets
1908-recyclable-and-low-fat-products

Segment Tree

3790-fruits-into-baskets-ii

Memoization

0070-climbing-stairs
3239-minimum-number-of-operations-to-make-x-and-y-equal

Combinatorics

0062-unique-paths

Monotonic Queue

0239-sliding-window-maximum

Trie

0014-longest-common-prefix

Doubly-Linked List

0146-lru-cache

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published