Skip to content

chonyy/leetcode-solutions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

leetcode-solutions

Yes, I still hate leetcode :(

LeetCode Topics

Linked List

2182-find-the-minimum-and-maximum-number-of-nodes-between-critical-points

Array

0001-two-sum
0049-group-anagrams
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0217-contains-duplicate
0347-top-k-frequent-elements
0624-maximum-distance-in-arrays
0905-length-of-longest-fibonacci-subsequence
0921-spiral-matrix-iii
0925-construct-binary-tree-from-preorder-and-postorder-traversal
1196-filling-bookcase-shelves
1207-delete-nodes-and-return-forest
1325-path-with-maximum-probability
1333-sort-the-jumbled-numbers
1364-tuple-with-same-product
1477-product-of-the-last-k-numbers
1496-lucky-numbers-in-a-matrix
1511-count-number-of-teams
1556-make-two-arrays-equal-by-reversing-subarrays
1615-range-sum-of-sorted-subarray-sums
1631-number-of-sub-arrays-with-odd-sum
1691-minimum-number-of-days-to-disconnect-island
1711-find-valid-matrix-given-row-and-column-sums
1803-average-waiting-time
1819-construct-the-lexicographically-largest-valid-sequence
1849-maximum-absolute-sum-of-any-subarray
1951-find-the-winner-of-the-circular-game
2067-maximum-number-of-points-with-cost
2107-find-unique-binary-string
2163-kth-distinct-string-in-an-array
2255-minimum-swaps-to-group-all-1s-together-ii
2265-partition-array-according-to-given-pivot
2448-count-number-of-bad-pairs
2472-build-a-matrix-with-conditions
2473-max-sum-of-a-pair-with-equal-sum-of-digits
2502-sort-the-people
2551-apply-operations-to-an-array
2564-most-profitable-path-in-a-tree
2707-merge-two-2d-arrays-by-summing-values
2727-number-of-senior-citizens
2846-robot-collisions
3227-find-missing-and-repeated-values
3235-minimum-cost-to-convert-string-i
3434-find-the-number-of-distinct-colors-among-the-balls
3483-alternating-groups-ii

Math

0264-ugly-number-ii
0592-fraction-addition-and-subtraction
1477-product-of-the-last-k-numbers
1631-number-of-sub-arrays-with-odd-sum
1889-check-if-number-is-a-sum-of-powers-of-three
1951-find-the-winner-of-the-circular-game
2448-count-number-of-bad-pairs
2649-count-total-number-of-colored-cells
2802-find-the-punishment-number-of-an-integer
3227-find-missing-and-repeated-values

Recursion

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

Queue

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

Simulation

0592-fraction-addition-and-subtraction
0921-spiral-matrix-iii
1803-average-waiting-time
1951-find-the-winner-of-the-circular-game
2021-remove-all-occurrences-of-a-substring
2265-partition-array-according-to-given-pivot
2551-apply-operations-to-an-array
2846-robot-collisions
3434-find-the-number-of-distinct-colors-among-the-balls
3447-clear-digits

String

0049-group-anagrams
0242-valid-anagram
0592-fraction-addition-and-subtraction
0726-number-of-atoms
1093-recover-a-tree-from-preorder-traversal
1170-shortest-common-supersequence
1298-reverse-substrings-between-each-pair-of-parentheses
1516-the-k-th-lexicographical-string-of-all-happy-strings-of-length-n
1756-minimum-deletions-to-make-string-balanced
1915-check-if-one-string-swap-can-make-strings-equal
2021-remove-all-occurrences-of-a-substring
2107-find-unique-binary-string
2163-kth-distinct-string-in-an-array
2463-minimum-recolors-to-get-k-consecutive-black-blocks
2502-sort-the-people
2727-number-of-senior-citizens
3235-minimum-cost-to-convert-string-i
3276-minimum-number-of-pushes-to-type-word-ii
3447-clear-digits

Stack

0145-binary-tree-postorder-traversal
0726-number-of-atoms
0776-n-ary-tree-postorder-traversal
1298-reverse-substrings-between-each-pair-of-parentheses
1756-minimum-deletions-to-make-string-balanced
2021-remove-all-occurrences-of-a-substring
2846-robot-collisions
3447-clear-digits

Sorting

0049-group-anagrams
0217-contains-duplicate
0242-valid-anagram
0347-top-k-frequent-elements
0726-number-of-atoms
1333-sort-the-jumbled-numbers
1556-make-two-arrays-equal-by-reversing-subarrays
1615-range-sum-of-sorted-subarray-sums
2473-max-sum-of-a-pair-with-equal-sum-of-digits
2502-sort-the-people
2846-robot-collisions
3276-minimum-number-of-pushes-to-type-word-ii

Hash Table

0001-two-sum
0049-group-anagrams
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0217-contains-duplicate
0242-valid-anagram
0264-ugly-number-ii
0347-top-k-frequent-elements
0726-number-of-atoms
0905-length-of-longest-fibonacci-subsequence
0925-construct-binary-tree-from-preorder-and-postorder-traversal
1207-delete-nodes-and-return-forest
1364-tuple-with-same-product
1387-find-elements-in-a-contaminated-binary-tree
1556-make-two-arrays-equal-by-reversing-subarrays
1915-check-if-one-string-swap-can-make-strings-equal
2107-find-unique-binary-string
2163-kth-distinct-string-in-an-array
2434-design-a-number-container-system
2448-count-number-of-bad-pairs
2473-max-sum-of-a-pair-with-equal-sum-of-digits
2502-sort-the-people
2707-merge-two-2d-arrays-by-summing-values
3227-find-missing-and-repeated-values
3276-minimum-number-of-pushes-to-type-word-ii
3434-find-the-number-of-distinct-colors-among-the-balls

Tree

0105-construct-binary-tree-from-preorder-and-inorder-traversal
0145-binary-tree-postorder-traversal
0776-n-ary-tree-postorder-traversal
0789-kth-largest-element-in-a-stream
0925-construct-binary-tree-from-preorder-and-postorder-traversal
1093-recover-a-tree-from-preorder-traversal
1207-delete-nodes-and-return-forest
1387-find-elements-in-a-contaminated-binary-tree
1653-number-of-good-leaf-nodes-pairs
2564-most-profitable-path-in-a-tree

Depth-First Search

0145-binary-tree-postorder-traversal
0776-n-ary-tree-postorder-traversal
1093-recover-a-tree-from-preorder-traversal
1207-delete-nodes-and-return-forest
1387-find-elements-in-a-contaminated-binary-tree
1653-number-of-good-leaf-nodes-pairs
1691-minimum-number-of-days-to-disconnect-island
2564-most-profitable-path-in-a-tree

Binary Tree

0105-construct-binary-tree-from-preorder-and-inorder-traversal
0145-binary-tree-postorder-traversal
0789-kth-largest-element-in-a-stream
0925-construct-binary-tree-from-preorder-and-postorder-traversal
1093-recover-a-tree-from-preorder-traversal
1207-delete-nodes-and-return-forest
1387-find-elements-in-a-contaminated-binary-tree
1653-number-of-good-leaf-nodes-pairs

Matrix

0921-spiral-matrix-iii
1496-lucky-numbers-in-a-matrix
1691-minimum-number-of-days-to-disconnect-island
1711-find-valid-matrix-given-row-and-column-sums
2472-build-a-matrix-with-conditions
3227-find-missing-and-repeated-values

Greedy

0624-maximum-distance-in-arrays
1711-find-valid-matrix-given-row-and-column-sums
3276-minimum-number-of-pushes-to-type-word-ii

Graph

1325-path-with-maximum-probability
2472-build-a-matrix-with-conditions
2564-most-profitable-path-in-a-tree
3235-minimum-cost-to-convert-string-i

Topological Sort

2472-build-a-matrix-with-conditions

Shortest Path

1325-path-with-maximum-probability
3235-minimum-cost-to-convert-string-i

Dynamic Programming

0264-ugly-number-ii
0905-length-of-longest-fibonacci-subsequence
1170-shortest-common-supersequence
1196-filling-bookcase-shelves
1511-count-number-of-teams
1631-number-of-sub-arrays-with-odd-sum
1756-minimum-deletions-to-make-string-balanced
1849-maximum-absolute-sum-of-any-subarray
2067-maximum-number-of-points-with-cost

Binary Indexed Tree

1511-count-number-of-teams

Sliding Window

2255-minimum-swaps-to-group-all-1s-together-ii
2463-minimum-recolors-to-get-k-consecutive-black-blocks
3483-alternating-groups-ii

Two Pointers

1615-range-sum-of-sorted-subarray-sums
2265-partition-array-according-to-given-pivot
2551-apply-operations-to-an-array
2707-merge-two-2d-arrays-by-summing-values

Binary Search

1615-range-sum-of-sorted-subarray-sums

Counting

0347-top-k-frequent-elements
1364-tuple-with-same-product
1915-check-if-one-string-swap-can-make-strings-equal
2163-kth-distinct-string-in-an-array
2448-count-number-of-bad-pairs
3276-minimum-number-of-pushes-to-type-word-ii

Breadth-First Search

1387-find-elements-in-a-contaminated-binary-tree
1691-minimum-number-of-days-to-disconnect-island
2564-most-profitable-path-in-a-tree

Strongly Connected Component

1691-minimum-number-of-days-to-disconnect-island

Design

0789-kth-largest-element-in-a-stream
1387-find-elements-in-a-contaminated-binary-tree
1477-product-of-the-last-k-numbers
2434-design-a-number-container-system

Binary Search Tree

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

Heap (Priority Queue)

0264-ugly-number-ii
0347-top-k-frequent-elements
0789-kth-largest-element-in-a-stream
1325-path-with-maximum-probability
2434-design-a-number-container-system
2473-max-sum-of-a-pair-with-equal-sum-of-digits

Data Stream

0789-kth-largest-element-in-a-stream
1477-product-of-the-last-k-numbers

Bit Manipulation

0476-number-complement

Ordered Set

2434-design-a-number-container-system

Divide and Conquer

0105-construct-binary-tree-from-preorder-and-inorder-traversal
0347-top-k-frequent-elements
0925-construct-binary-tree-from-preorder-and-postorder-traversal

Bucket Sort

0347-top-k-frequent-elements

Quickselect

0347-top-k-frequent-elements

Prefix Sum

1477-product-of-the-last-k-numbers
1631-number-of-sub-arrays-with-odd-sum

Backtracking

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
2802-find-the-punishment-number-of-an-integer

About

Yes, I still hate leetcode :(

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published