Skip to content

Collection of @leetcode problems Daily Challenges and their possible solutions with different approaches along side the @leetcode @topics of DSA.Below review the LeetCode-Profile

Notifications You must be signed in to change notification settings

mj-awad17/LeetCode-Problems-Solutions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeetCode-Solutioins

Embark on a journey of growth and mastery with this comprehensive collection of LeetCode questions. Equip yourself with the necessary tools and techniques to excel in your coding interviews.

Backtracking

0077-combinations

Array

1833-find-the-highest-altitude

Prefix Sum

1833-find-the-highest-altitude

Graph

1916-find-center-of-star-graph

Hash Table

0782-jewels-and-stones

String

0782-jewels-and-stones

LeetCode Topics

Array

0001-two-sum
0004-median-of-two-sorted-arrays
0011-container-with-most-water
0027-remove-element
0035-search-insert-position
0040-combination-sum-ii
0056-merge-intervals
0088-merge-sorted-array
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0152-maximum-product-subarray
0167-two-sum-ii-input-array-is-sorted
0217-contains-duplicate
0238-product-of-array-except-self
0283-move-zeroes
0334-increasing-triplet-subsequence
0350-intersection-of-two-arrays-ii
0435-non-overlapping-intervals
0452-minimum-number-of-arrows-to-burst-balloons
0500-keyboard-row
0605-can-place-flowers
0624-maximum-distance-in-arrays
0643-maximum-average-subarray-i
0735-asteroid-collision
0739-daily-temperatures
0810-valid-tic-tac-toe-state
0854-making-a-large-island
0870-magic-squares-in-grid
1046-max-consecutive-ones-iii
1231-replace-elements-with-greatest-element-on-right-side
1256-rank-transform-of-an-array
1293-three-consecutive-odds
1319-unique-number-of-occurrences
1364-tuple-with-same-product
1392-find-the-difference-of-two-arrays
1435-xor-queries-of-a-subarray
1528-kids-with-the-greatest-number-of-candies
1580-shuffle-the-array
1586-longest-subarray-of-1s-after-deleting-one-element
1616-minimum-difference-between-largest-and-smallest-value-in-three-moves
1620-check-if-array-pairs-are-divisible-by-k
1786-count-the-number-of-consistent-strings
1798-max-number-of-k-sum-pairs
1803-average-waiting-time
1833-find-the-highest-altitude
1951-find-the-winner-of-the-circular-game
2058-concatenation-of-array
2163-kth-distinct-string-in-an-array
2164-two-best-non-overlapping-events
2232-adding-spaces-to-a-string
2356-largest-combination-with-bitwise-and-greater-than-zero
2392-successful-pairs-of-spells-and-potions
2428-equal-row-and-column-pairs
2503-longest-subarray-with-maximum-bitwise-and
3372-longest-strictly-increasing-or-strictly-decreasing-subarray
3501-delete-nodes-from-linked-list-present-in-array

Hash Table

0001-two-sum
0013-roman-to-integer
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0142-linked-list-cycle-ii
0217-contains-duplicate
0350-intersection-of-two-arrays-ii
0500-keyboard-row
0870-magic-squares-in-grid
1256-rank-transform-of-an-array
1319-unique-number-of-occurrences
1364-tuple-with-same-product
1392-find-the-difference-of-two-arrays
1620-check-if-array-pairs-are-divisible-by-k
1786-count-the-number-of-consistent-strings
1798-max-number-of-k-sum-pairs
2163-kth-distinct-string-in-an-array
2356-largest-combination-with-bitwise-and-greater-than-zero
2428-equal-row-and-column-pairs
3353-existence-of-a-substring-in-a-string-and-its-reverse
3501-delete-nodes-from-linked-list-present-in-array

Sorting

0056-merge-intervals
0088-merge-sorted-array
0217-contains-duplicate
0350-intersection-of-two-arrays-ii
0435-non-overlapping-intervals
0452-minimum-number-of-arrows-to-burst-balloons
1256-rank-transform-of-an-array
1616-minimum-difference-between-largest-and-smallest-value-in-three-moves
1798-max-number-of-k-sum-pairs
2164-two-best-non-overlapping-events
2379-maximum-total-importance-of-roads
2392-successful-pairs-of-spells-and-potions

Greedy

0011-container-with-most-water
0334-increasing-triplet-subsequence
0435-non-overlapping-intervals
0452-minimum-number-of-arrows-to-burst-balloons
0605-can-place-flowers
0624-maximum-distance-in-arrays
0649-dota2-senate
0680-valid-palindrome-ii
1616-minimum-difference-between-largest-and-smallest-value-in-three-moves
2379-maximum-total-importance-of-roads

Graph

0547-number-of-provinces
0871-keys-and-rooms
2379-maximum-total-importance-of-roads

Heap (Priority Queue)

2164-two-best-non-overlapping-events
2379-maximum-total-importance-of-roads

Linked List

0019-remove-nth-node-from-end-of-list
0021-merge-two-sorted-lists
0142-linked-list-cycle-ii
0143-reorder-list
0206-reverse-linked-list
0328-odd-even-linked-list
2182-find-the-minimum-and-maximum-number-of-nodes-between-critical-points
2216-delete-the-middle-node-of-a-linked-list
2236-maximum-twin-sum-of-a-linked-list
2871-double-a-number-represented-as-a-linked-list
3501-delete-nodes-from-linked-list-present-in-array

Math

0013-roman-to-integer
0029-divide-two-integers
0069-sqrtx
0070-climbing-stairs
0096-unique-binary-search-trees
0231-power-of-two
0870-magic-squares-in-grid
1146-greatest-common-divisor-of-strings
1642-water-bottles
1951-find-the-winner-of-the-circular-game
2871-double-a-number-represented-as-a-linked-list
3172-divisible-and-non-divisible-sums-difference

Stack

0020-valid-parentheses
0143-reorder-list
0394-decode-string
0735-asteroid-collision
0739-daily-temperatures
2236-maximum-twin-sum-of-a-linked-list
2470-removing-stars-from-a-string
2871-double-a-number-represented-as-a-linked-list

Simulation

0735-asteroid-collision
1642-water-bottles
1803-average-waiting-time
1951-find-the-winner-of-the-circular-game
2058-concatenation-of-array
2232-adding-spaces-to-a-string
2428-equal-row-and-column-pairs
2470-removing-stars-from-a-string

Two Pointers

0005-longest-palindromic-substring
0011-container-with-most-water
0019-remove-nth-node-from-end-of-list
0027-remove-element
0088-merge-sorted-array
0142-linked-list-cycle-ii
0143-reorder-list
0151-reverse-words-in-a-string
0167-two-sum-ii-input-array-is-sorted
0283-move-zeroes
0344-reverse-string
0345-reverse-vowels-of-a-string
0350-intersection-of-two-arrays-ii
0392-is-subsequence
0443-string-compression
0680-valid-palindrome-ii
1798-max-number-of-k-sum-pairs
1894-merge-strings-alternately
2216-delete-the-middle-node-of-a-linked-list
2232-adding-spaces-to-a-string
2236-maximum-twin-sum-of-a-linked-list
2392-successful-pairs-of-spells-and-potions
3018-make-string-a-subsequence-using-cyclic-increments

String

0005-longest-palindromic-substring
0006-zigzag-conversion
0013-roman-to-integer
0014-longest-common-prefix
0020-valid-parentheses
0151-reverse-words-in-a-string
0344-reverse-string
0345-reverse-vowels-of-a-string
0392-is-subsequence
0394-decode-string
0443-string-compression
0500-keyboard-row
0649-dota2-senate
0680-valid-palindrome-ii
0812-rotate-string
1146-greatest-common-divisor-of-strings
1567-maximum-number-of-vowels-in-a-substring-of-given-length
1786-count-the-number-of-consistent-strings
1894-merge-strings-alternately
2163-kth-distinct-string-in-an-array
2232-adding-spaces-to-a-string
2470-removing-stars-from-a-string
3018-make-string-a-subsequence-using-cyclic-increments
3353-existence-of-a-substring-in-a-string-and-its-reverse

Dynamic Programming

0005-longest-palindromic-substring
0070-climbing-stairs
0096-unique-binary-search-trees
0152-maximum-product-subarray
0338-counting-bits
0392-is-subsequence
0435-non-overlapping-intervals
1586-longest-subarray-of-1s-after-deleting-one-element
2164-two-best-non-overlapping-events

Binary Search

0004-median-of-two-sorted-arrays
0035-search-insert-position
0069-sqrtx
0167-two-sum-ii-input-array-is-sorted
0350-intersection-of-two-arrays-ii
0374-guess-number-higher-or-lower
1046-max-consecutive-ones-iii
2164-two-best-non-overlapping-events
2392-successful-pairs-of-spells-and-potions

Interactive

0374-guess-number-higher-or-lower

Recursion

0021-merge-two-sorted-lists
0143-reorder-list
0206-reverse-linked-list
0231-power-of-two
0394-decode-string
1951-find-the-winner-of-the-circular-game

Queue

0649-dota2-senate
0969-number-of-recent-calls
1951-find-the-winner-of-the-circular-game

Trie

0014-longest-common-prefix

Memoization

0070-climbing-stairs

Counting

1364-tuple-with-same-product
1620-check-if-array-pairs-are-divisible-by-k
1786-count-the-number-of-consistent-strings
2163-kth-distinct-string-in-an-array
2356-largest-combination-with-bitwise-and-greater-than-zero

Matrix

0810-valid-tic-tac-toe-state
0854-making-a-large-island
0870-magic-squares-in-grid
2428-equal-row-and-column-pairs

Backtracking

0040-combination-sum-ii

Depth-First Search

0104-maximum-depth-of-binary-tree
0199-binary-tree-right-side-view
0230-kth-smallest-element-in-a-bst
0236-lowest-common-ancestor-of-a-binary-tree
0437-path-sum-iii
0547-number-of-provinces
0854-making-a-large-island
0871-keys-and-rooms
0904-leaf-similar-trees
1116-maximum-level-sum-of-a-binary-tree

Breadth-First Search

0102-binary-tree-level-order-traversal
0104-maximum-depth-of-binary-tree
0199-binary-tree-right-side-view
0547-number-of-provinces
0854-making-a-large-island
0871-keys-and-rooms
1116-maximum-level-sum-of-a-binary-tree

Union Find

0547-number-of-provinces
0854-making-a-large-island

Tree

0096-unique-binary-search-trees
0102-binary-tree-level-order-traversal
0104-maximum-depth-of-binary-tree
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0199-binary-tree-right-side-view
0230-kth-smallest-element-in-a-bst
0236-lowest-common-ancestor-of-a-binary-tree
0437-path-sum-iii
0450-delete-node-in-a-bst
0783-search-in-a-binary-search-tree
0904-leaf-similar-trees
1116-maximum-level-sum-of-a-binary-tree

Binary Tree

0096-unique-binary-search-trees
0102-binary-tree-level-order-traversal
0104-maximum-depth-of-binary-tree
0105-construct-binary-tree-from-preorder-and-inorder-traversal
0199-binary-tree-right-side-view
0230-kth-smallest-element-in-a-bst
0236-lowest-common-ancestor-of-a-binary-tree
0437-path-sum-iii
0450-delete-node-in-a-bst
0783-search-in-a-binary-search-tree
0904-leaf-similar-trees
1116-maximum-level-sum-of-a-binary-tree

Binary Search Tree

0096-unique-binary-search-trees
0230-kth-smallest-element-in-a-bst
0450-delete-node-in-a-bst
0783-search-in-a-binary-search-tree

Bit Manipulation

0029-divide-two-integers
0231-power-of-two
0338-counting-bits
1435-xor-queries-of-a-subarray
1441-minimum-flips-to-make-a-or-b-equal-to-c
1786-count-the-number-of-consistent-strings
2323-minimum-bit-flips-to-convert-number
2356-largest-combination-with-bitwise-and-greater-than-zero
2503-longest-subarray-with-maximum-bitwise-and

Prefix Sum

0238-product-of-array-except-self
1046-max-consecutive-ones-iii
1435-xor-queries-of-a-subarray
1833-find-the-highest-altitude

Brainteaser

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

Divide and Conquer

0004-median-of-two-sorted-arrays
0105-construct-binary-tree-from-preorder-and-inorder-traversal

Sliding Window

0643-maximum-average-subarray-i
1046-max-consecutive-ones-iii
1567-maximum-number-of-vowels-in-a-substring-of-given-length
1586-longest-subarray-of-1s-after-deleting-one-element

String Matching

0812-rotate-string

Design

0969-number-of-recent-calls

Data Stream

0969-number-of-recent-calls

Monotonic Stack

0739-daily-temperatures

About

Collection of @leetcode problems Daily Challenges and their possible solutions with different approaches along side the @leetcode @topics of DSA.Below review the LeetCode-Profile

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages