Skip to content

RafyHany/Problem-solving

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

775 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hash Table

0409-longest-palindrome
1044-find-common-characters
0876-hand-of-straights
0523-continuous-subarray-sum
1016-subarray-sums-divisible-by-k
1217-relative-sort-array
0003-longest-substring-without-repeating-characters
0073-set-matrix-zeroes

String

0003-longest-substring-without-repeating-characters
0020-valid-parentheses
0409-longest-palindrome
1044-find-common-characters

Greedy

0409-longest-palindrome
0876-hand-of-straights
0982-minimum-increment-to-make-array-unique
1285-balance-a-binary-search-tree
2148-minimum-number-of-moves-to-seat-everyone

Array

0073-set-matrix-zeroes
0075-sort-colors
0523-continuous-subarray-sum
0876-hand-of-straights
0982-minimum-increment-to-make-array-unique
1016-subarray-sums-divisible-by-k
1044-find-common-characters
1137-height-checker
1217-relative-sort-array
2148-minimum-number-of-moves-to-seat-everyone

Sorting

0075-sort-colors
0876-hand-of-straights
0982-minimum-increment-to-make-array-unique
1137-height-checker
1217-relative-sort-array
2148-minimum-number-of-moves-to-seat-everyone

Math

0523-continuous-subarray-sum

Prefix Sum

0523-continuous-subarray-sum
1016-subarray-sums-divisible-by-k

Counting

0982-minimum-increment-to-make-array-unique

Tree

0098-validate-binary-search-tree
0102-binary-tree-level-order-traversal
1114-binary-search-tree-to-greater-sum-tree
1285-balance-a-binary-search-tree

Depth-First Search

0098-validate-binary-search-tree
1114-binary-search-tree-to-greater-sum-tree
1285-balance-a-binary-search-tree

Binary Search Tree

0098-validate-binary-search-tree
1114-binary-search-tree-to-greater-sum-tree
1285-balance-a-binary-search-tree

Binary Tree

0098-validate-binary-search-tree
0102-binary-tree-level-order-traversal
1114-binary-search-tree-to-greater-sum-tree
1285-balance-a-binary-search-tree

Counting Sort

1137-height-checker
1217-relative-sort-array

Two Pointers

0075-sort-colors

Sliding Window

0003-longest-substring-without-repeating-characters

Divide and Conquer

1285-balance-a-binary-search-tree

Breadth-First Search

0102-binary-tree-level-order-traversal

Graph

1916-find-center-of-star-graph

Matrix

0073-set-matrix-zeroes

Dynamic Programming

0338-counting-bits

Bit Manipulation

0338-counting-bits

Stack

0020-valid-parentheses

LeetCode Topics

Greedy

0179-largest-number
0624-maximum-distance-in-arrays
0890-lemonade-change
0957-minimum-add-to-make-parentheses-valid
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
2379-maximum-total-importance-of-roads
2616-maximal-score-after-applying-k-operations
3276-minimum-number-of-pushes-to-type-word-ii

Graph

0984-most-stones-removed-with-same-row-or-column
1325-path-with-maximum-probability
1431-all-ancestors-of-a-node-in-a-directed-acyclic-graph
1701-remove-max-number-of-edges-to-keep-graph-fully-traversable
2379-maximum-total-importance-of-roads
2472-build-a-matrix-with-conditions
2803-modify-graph-edge-weights

Sorting

0088-merge-sorted-array
0179-largest-number
0242-valid-anagram
0350-intersection-of-two-arrays-ii
0539-minimum-time-difference
0719-find-k-th-smallest-pair-distance
0726-number-of-atoms
0948-sort-an-array
1256-rank-transform-of-an-array
1333-sort-the-jumbled-numbers
1556-make-two-arrays-equal-by-reversing-subarrays
1615-range-sum-of-sorted-subarray-sums
1616-minimum-difference-between-largest-and-smallest-value-in-three-moves
1741-sort-array-by-increasing-frequency
2379-maximum-total-importance-of-roads
2502-sort-the-people
2581-divide-players-into-teams-of-equal-skill
2846-robot-collisions
3276-minimum-number-of-pushes-to-type-word-ii

Heap (Priority Queue)

0264-ugly-number-ii
0789-kth-largest-element-in-a-stream
0948-sort-an-array
1325-path-with-maximum-probability
2379-maximum-total-importance-of-roads
2616-maximal-score-after-applying-k-operations
2803-modify-graph-edge-weights

Depth-First Search

0094-binary-tree-inorder-traversal
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0386-lexicographical-numbers
0543-diameter-of-binary-tree
0775-n-ary-tree-preorder-traversal
0776-n-ary-tree-postorder-traversal
0984-most-stones-removed-with-same-row-or-column
0999-regions-cut-by-slashes
1207-delete-nodes-and-return-forest
1431-all-ancestors-of-a-node-in-a-directed-acyclic-graph
1484-linked-list-in-binary-tree
1653-number-of-good-leaf-nodes-pairs
1691-minimum-number-of-days-to-disconnect-island
2035-count-sub-islands
2217-step-by-step-directions-from-a-binary-tree-node-to-another

Breadth-First Search

0322-coin-change
0999-regions-cut-by-slashes
1431-all-ancestors-of-a-node-in-a-directed-acyclic-graph
1484-linked-list-in-binary-tree
1691-minimum-number-of-days-to-disconnect-island
2035-count-sub-islands

Topological Sort

1431-all-ancestors-of-a-node-in-a-directed-acyclic-graph
2472-build-a-matrix-with-conditions

Union Find

0984-most-stones-removed-with-same-row-or-column
0999-regions-cut-by-slashes
1701-remove-max-number-of-edges-to-keep-graph-fully-traversable
2035-count-sub-islands

Array

0040-combination-sum-ii
0048-rotate-image
0054-spiral-matrix
0079-word-search
0088-merge-sorted-array
0121-best-time-to-buy-and-sell-stock
0153-find-minimum-in-rotated-sorted-array
0179-largest-number
0322-coin-change
0350-intersection-of-two-arrays-ii
0539-minimum-time-difference
0624-maximum-distance-in-arrays
0719-find-k-th-smallest-pair-distance
0729-my-calendar-i
0731-my-calendar-ii
0859-design-circular-deque
0870-magic-squares-in-grid
0890-lemonade-change
0906-walking-robot-simulation
0948-sort-an-array
0999-regions-cut-by-slashes
1196-filling-bookcase-shelves
1207-delete-nodes-and-return-forest
1240-stone-game-ii
1256-rank-transform-of-an-array
1293-three-consecutive-odds
1325-path-with-maximum-probability
1333-sort-the-jumbled-numbers
1435-xor-queries-of-a-subarray
1496-lucky-numbers-in-a-matrix
1497-design-a-stack-with-increment-operation
1511-count-number-of-teams
1556-make-two-arrays-equal-by-reversing-subarrays
1615-range-sum-of-sorted-subarray-sums
1616-minimum-difference-between-largest-and-smallest-value-in-three-moves
1620-check-if-array-pairs-are-divisible-by-k
1691-minimum-number-of-days-to-disconnect-island
1694-make-sum-divisible-by-p
1711-find-valid-matrix-given-row-and-column-sums
1720-crawler-log-folder
1741-sort-array-by-increasing-frequency
1786-count-the-number-of-consistent-strings
1803-average-waiting-time
1951-find-the-winner-of-the-circular-game
2006-find-the-student-that-will-replace-the-chalk
2035-count-sub-islands
2067-maximum-number-of-points-with-cost
2132-convert-1d-array-into-2d-array
2155-find-missing-observations
2255-minimum-swaps-to-group-all-1s-together-ii
2306-create-binary-tree-from-descriptions
2411-spiral-matrix-iv
2472-build-a-matrix-with-conditions
2494-sum-of-prefix-scores-of-strings
2502-sort-the-people
2503-longest-subarray-with-maximum-bitwise-and
2581-divide-players-into-teams-of-equal-skill
2616-maximal-score-after-applying-k-operations
2727-number-of-senior-citizens
2755-extra-characters-in-a-string
2846-robot-collisions
3329-find-the-length-of-the-longest-common-prefix
3501-delete-nodes-from-linked-list-present-in-array

Two Pointers

0019-remove-nth-node-from-end-of-list
0088-merge-sorted-array
0350-intersection-of-two-arrays-ii
0719-find-k-th-smallest-pair-distance
1615-range-sum-of-sorted-subarray-sums
2581-divide-players-into-teams-of-equal-skill

String

0079-word-search
0179-largest-number
0214-shortest-palindrome
0241-different-ways-to-add-parentheses
0242-valid-anagram
0273-integer-to-english-words
0539-minimum-time-difference
0564-find-the-closest-palindrome
0592-fraction-addition-and-subtraction
0726-number-of-atoms
0920-uncommon-words-from-two-sentences
0957-minimum-add-to-make-parentheses-valid
1298-reverse-substrings-between-each-pair-of-parentheses
1302-delete-characters-to-make-fancy-string
1473-find-the-longest-substring-containing-vowels-in-even-counts
1537-maximum-score-after-splitting-a-string
1720-crawler-log-folder
1756-minimum-deletions-to-make-string-balanced
1786-count-the-number-of-consistent-strings
1818-maximum-score-from-removing-substrings
2076-sum-of-digits-of-string-after-convert
2217-step-by-step-directions-from-a-binary-tree-node-to-another
2494-sum-of-prefix-scores-of-strings
2502-sort-the-people
2580-circular-sentence
2727-number-of-senior-citizens
2755-extra-characters-in-a-string
2800-minimum-string-length-after-removing-substrings
3276-minimum-number-of-pushes-to-type-word-ii
3329-find-the-length-of-the-longest-common-prefix

Backtracking

0040-combination-sum-ii
0079-word-search

Matrix

0048-rotate-image
0054-spiral-matrix
0079-word-search
0870-magic-squares-in-grid
0999-regions-cut-by-slashes
1496-lucky-numbers-in-a-matrix
1691-minimum-number-of-days-to-disconnect-island
1711-find-valid-matrix-given-row-and-column-sums
2035-count-sub-islands
2132-convert-1d-array-into-2d-array
2411-spiral-matrix-iv
2472-build-a-matrix-with-conditions

Math

0048-rotate-image
0241-different-ways-to-add-parentheses
0264-ugly-number-ii
0273-integer-to-english-words
0539-minimum-time-difference
0564-find-the-closest-palindrome
0592-fraction-addition-and-subtraction
0650-2-keys-keyboard
0870-magic-squares-in-grid
1240-stone-game-ii
1642-water-bottles
1951-find-the-winner-of-the-circular-game
2155-find-missing-observations
2645-pass-the-pillow
2903-insert-greatest-common-divisors-in-linked-list

Linked List

0019-remove-nth-node-from-end-of-list
0432-all-oone-data-structure
0725-split-linked-list-in-parts
0859-design-circular-deque
1484-linked-list-in-binary-tree
2182-find-the-minimum-and-maximum-number-of-nodes-between-critical-points
2299-merge-nodes-in-between-zeros
2411-spiral-matrix-iv
2903-insert-greatest-common-divisors-in-linked-list
3501-delete-nodes-from-linked-list-present-in-array

Hash Table

0242-valid-anagram
0264-ugly-number-ii
0350-intersection-of-two-arrays-ii
0432-all-oone-data-structure
0726-number-of-atoms
0870-magic-squares-in-grid
0906-walking-robot-simulation
0920-uncommon-words-from-two-sentences
0984-most-stones-removed-with-same-row-or-column
0999-regions-cut-by-slashes
1207-delete-nodes-and-return-forest
1256-rank-transform-of-an-array
1473-find-the-longest-substring-containing-vowels-in-even-counts
1556-make-two-arrays-equal-by-reversing-subarrays
1620-check-if-array-pairs-are-divisible-by-k
1694-make-sum-divisible-by-p
1741-sort-array-by-increasing-frequency
1786-count-the-number-of-consistent-strings
2306-create-binary-tree-from-descriptions
2502-sort-the-people
2581-divide-players-into-teams-of-equal-skill
2755-extra-characters-in-a-string
3276-minimum-number-of-pushes-to-type-word-ii
3329-find-the-length-of-the-longest-common-prefix
3501-delete-nodes-from-linked-list-present-in-array

Binary Search

0153-find-minimum-in-rotated-sorted-array
0350-intersection-of-two-arrays-ii
0719-find-k-th-smallest-pair-distance
0729-my-calendar-i
0731-my-calendar-ii
1615-range-sum-of-sorted-subarray-sums
2006-find-the-student-that-will-replace-the-chalk

Stack

0094-binary-tree-inorder-traversal
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0726-number-of-atoms
0775-n-ary-tree-preorder-traversal
0776-n-ary-tree-postorder-traversal
0957-minimum-add-to-make-parentheses-valid
1298-reverse-substrings-between-each-pair-of-parentheses
1497-design-a-stack-with-increment-operation
1720-crawler-log-folder
1756-minimum-deletions-to-make-string-balanced
1818-maximum-score-from-removing-substrings
2800-minimum-string-length-after-removing-substrings
2846-robot-collisions

Database

0584-find-customer-referee
0595-big-countries
1153-product-sales-analysis-i
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

Simulation

0054-spiral-matrix
0592-fraction-addition-and-subtraction
0906-walking-robot-simulation
1642-water-bottles
1803-average-waiting-time
1951-find-the-winner-of-the-circular-game
2006-find-the-student-that-will-replace-the-chalk
2076-sum-of-digits-of-string-after-convert
2132-convert-1d-array-into-2d-array
2155-find-missing-observations
2299-merge-nodes-in-between-zeros
2411-spiral-matrix-iv
2645-pass-the-pillow
2800-minimum-string-length-after-removing-substrings
2846-robot-collisions

Tree

0094-binary-tree-inorder-traversal
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0543-diameter-of-binary-tree
0775-n-ary-tree-preorder-traversal
0776-n-ary-tree-postorder-traversal
0789-kth-largest-element-in-a-stream
1207-delete-nodes-and-return-forest
1484-linked-list-in-binary-tree
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

Binary Tree

0094-binary-tree-inorder-traversal
0144-binary-tree-preorder-traversal
0145-binary-tree-postorder-traversal
0543-diameter-of-binary-tree
0789-kth-largest-element-in-a-stream
1207-delete-nodes-and-return-forest
1484-linked-list-in-binary-tree
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

Recursion

0241-different-ways-to-add-parentheses
0273-integer-to-english-words
1951-find-the-winner-of-the-circular-game

Queue

0859-design-circular-deque
1951-find-the-winner-of-the-circular-game

Divide and Conquer

0948-sort-an-array

Merge Sort

0948-sort-an-array

Bucket Sort

0948-sort-an-array

Radix Sort

0948-sort-an-array

Counting Sort

0920-uncommon-words-from-two-sentences
0948-sort-an-array
1620-check-if-array-pairs-are-divisible-by-k
1786-count-the-number-of-consistent-strings
2494-sum-of-prefix-scores-of-strings
3276-minimum-number-of-pushes-to-type-word-ii

Dynamic Programming

0121-best-time-to-buy-and-sell-stock
0241-different-ways-to-add-parentheses
0264-ugly-number-ii
0322-coin-change
0650-2-keys-keyboard
1196-filling-bookcase-shelves
1240-stone-game-ii
1511-count-number-of-teams
1756-minimum-deletions-to-make-string-balanced
2067-maximum-number-of-points-with-cost
2755-extra-characters-in-a-string

Binary Indexed Tree

1511-count-number-of-teams

Sliding Window

2255-minimum-swaps-to-group-all-1s-together-ii

Strongly Connected Component

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

Design

0432-all-oone-data-structure
0729-my-calendar-i
0731-my-calendar-ii
0789-kth-largest-element-in-a-stream
0859-design-circular-deque
1497-design-a-stack-with-increment-operation

Binary Search Tree

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

Data Stream

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

Prefix Sum

0731-my-calendar-ii
1240-stone-game-ii
1435-xor-queries-of-a-subarray
1473-find-the-longest-substring-containing-vowels-in-even-counts
1537-maximum-score-after-splitting-a-string
1694-make-sum-divisible-by-p
2006-find-the-student-that-will-replace-the-chalk

Game Theory

1240-stone-game-ii

Bit Manipulation

0476-number-complement
1435-xor-queries-of-a-subarray
1473-find-the-longest-substring-containing-vowels-in-even-counts
1786-count-the-number-of-consistent-strings
2323-minimum-bit-flips-to-convert-number
2503-longest-subarray-with-maximum-bitwise-and

Shortest Path

1325-path-with-maximum-probability
2803-modify-graph-edge-weights

Number Theory

2903-insert-greatest-common-divisors-in-linked-list

Brainteaser

2503-longest-subarray-with-maximum-bitwise-and

Memoization

0241-different-ways-to-add-parentheses

Rolling Hash

0214-shortest-palindrome

String Matching

0214-shortest-palindrome

Hash Function

0214-shortest-palindrome

Trie

0386-lexicographical-numbers
0440-k-th-smallest-in-lexicographical-order
2494-sum-of-prefix-scores-of-strings
2755-extra-characters-in-a-string
3329-find-the-length-of-the-longest-common-prefix

Segment Tree

0729-my-calendar-i
0731-my-calendar-ii

Ordered Set

0729-my-calendar-i
0731-my-calendar-ii

Doubly-Linked List

0432-all-oone-data-structure

About

this repo for solution for problems

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published