Skip to content

This repository contains solutions for LeetCode Problems

Notifications You must be signed in to change notification settings

1abdelhalim/LeetCode-Solutions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeetCode-Problems

This repository contains solutions for problems found on LeetCode.

LeetCode Topics

String

0187-repeated-dna-sequences
0345-reverse-vowels-of-a-string
0387-first-unique-character-in-a-string
0389-find-the-difference
0415-add-strings
0648-replace-words
0812-rotate-string
0920-uncommon-words-from-two-sentences
1023-time-based-key-value-store
1156-occurrences-after-bigram
1524-string-matching-in-an-array
1537-maximum-score-after-splitting-a-string
1720-crawler-log-folder
1786-count-the-number-of-consistent-strings
1895-minimum-number-of-operations-to-move-all-balls-to-each-box
1899-count-items-matching-a-rule
1915-check-if-one-string-swap-can-make-strings-equal
2088-minimum-time-to-type-word-using-special-typewriter
2163-kth-distinct-string-in-an-array
2292-counting-words-with-a-given-prefix
2487-optimal-partition-of-string
2502-sort-the-people
2800-minimum-string-length-after-removing-substrings
3309-count-prefix-and-suffix-pairs-i
3447-clear-digits

Bit Manipulation

0136-single-number
0187-repeated-dna-sequences
0191-number-of-1-bits
0389-find-the-difference
0476-number-complement
1444-number-of-steps-to-reduce-a-number-to-zero
1610-xor-operation-in-an-array
1786-count-the-number-of-consistent-strings
2323-minimum-bit-flips-to-convert-number
3193-maximum-strong-pair-xor-i
3380-shortest-subarray-with-or-at-least-k-ii

Array

0001-two-sum
0136-single-number
0283-move-zeroes
0414-third-maximum-number
0435-non-overlapping-intervals
0506-relative-ranks
0621-task-scheduler
0648-replace-words
0654-maximum-binary-tree
0682-baseball-game
0890-lemonade-change
0917-boats-to-save-people
1050-construct-binary-search-tree-from-preorder-traversal
1127-last-stone-weight
1256-rank-transform-of-an-array
1396-count-servers-that-communicate
1468-check-if-n-and-its-double-exist
1505-create-target-array-in-the-given-order
1524-string-matching-in-an-array
1570-final-prices-with-a-special-discount-in-a-shop
1574-maximum-product-of-two-elements-in-an-array
1693-sum-of-all-odd-length-subarrays
1720-crawler-log-folder
1786-count-the-number-of-consistent-strings
1895-minimum-number-of-operations-to-move-all-balls-to-each-box
1899-count-items-matching-a-rule
2106-find-greatest-common-divisor-of-array
2112-minimum-difference-between-highest-and-lowest-of-k-scores
2122-count-special-quadruplets
2132-convert-1d-array-into-2d-array
2163-kth-distinct-string-in-an-array
2210-find-target-indices-after-sorting-array
2292-counting-words-with-a-given-prefix
2502-sort-the-people
2692-take-gifts-from-the-richest-pile
3193-maximum-strong-pair-xor-i
3206-find-common-elements-between-two-arrays
3309-count-prefix-and-suffix-pairs-i
3380-shortest-subarray-with-or-at-least-k-ii
3429-special-array-i
3471-minimum-average-of-smallest-and-largest-elements
3476-find-minimum-operations-to-make-all-elements-divisible-by-three
3555-final-array-state-after-k-multiplication-operations-i
3581-the-two-sneaky-numbers-of-digitville

Heap (Priority Queue)

0506-relative-ranks
0621-task-scheduler
0789-kth-largest-element-in-a-stream
1127-last-stone-weight
1574-maximum-product-of-two-elements-in-an-array
2692-take-gifts-from-the-richest-pile
3555-final-array-state-after-k-multiplication-operations-i

Tree

0098-validate-binary-search-tree
0530-minimum-absolute-difference-in-bst
0654-maximum-binary-tree
0789-kth-largest-element-in-a-stream
0930-all-possible-full-binary-trees
1050-construct-binary-search-tree-from-preorder-traversal
1243-sum-of-nodes-with-even-valued-grandparent
1544-count-good-nodes-in-binary-tree
2347-count-nodes-equal-to-average-of-subtree

Design

0225-implement-stack-using-queues
0789-kth-largest-element-in-a-stream
1023-time-based-key-value-store
1708-design-parking-system

Binary Search Tree

0098-validate-binary-search-tree
0530-minimum-absolute-difference-in-bst
0789-kth-largest-element-in-a-stream
1023-time-based-key-value-store
1050-construct-binary-search-tree-from-preorder-traversal
1468-check-if-n-and-its-double-exist
2210-find-target-indices-after-sorting-array

Binary Tree

0098-validate-binary-search-tree
0530-minimum-absolute-difference-in-bst
0654-maximum-binary-tree
0789-kth-largest-element-in-a-stream
0930-all-possible-full-binary-trees
1050-construct-binary-search-tree-from-preorder-traversal
1243-sum-of-nodes-with-even-valued-grandparent
1544-count-good-nodes-in-binary-tree
2347-count-nodes-equal-to-average-of-subtree

Data Stream

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

Math

0050-powx-n
0070-climbing-stairs
0292-nim-game
0319-bulb-switcher
0326-power-of-three
0415-add-strings
1362-airplane-seat-assignment-probability
1444-number-of-steps-to-reduce-a-number-to-zero
1585-the-kth-factor-of-n
1610-xor-operation-in-an-array
1693-sum-of-all-odd-length-subarrays
1965-sum-of-digits-in-base-k
2106-find-greatest-common-divisor-of-array
3476-find-minimum-operations-to-make-all-elements-divisible-by-three
3555-final-array-state-after-k-multiplication-operations-i
3581-the-two-sneaky-numbers-of-digitville

Greedy

0435-non-overlapping-intervals
0621-task-scheduler
0890-lemonade-change
0917-boats-to-save-people
2088-minimum-time-to-type-word-using-special-typewriter
2487-optimal-partition-of-string

Hash Table

0001-two-sum
0187-repeated-dna-sequences
0387-first-unique-character-in-a-string
0389-find-the-difference
0621-task-scheduler
0648-replace-words
0920-uncommon-words-from-two-sentences
1023-time-based-key-value-store
1256-rank-transform-of-an-array
1468-check-if-n-and-its-double-exist
1786-count-the-number-of-consistent-strings
1915-check-if-one-string-swap-can-make-strings-equal
2122-count-special-quadruplets
2163-kth-distinct-string-in-an-array
2487-optimal-partition-of-string
2502-sort-the-people
3193-maximum-strong-pair-xor-i
3206-find-common-elements-between-two-arrays
3581-the-two-sneaky-numbers-of-digitville

Sorting

0389-find-the-difference
0414-third-maximum-number
0435-non-overlapping-intervals
0506-relative-ranks
0621-task-scheduler
0917-boats-to-save-people
1256-rank-transform-of-an-array
1468-check-if-n-and-its-double-exist
1574-maximum-product-of-two-elements-in-an-array
2112-minimum-difference-between-highest-and-lowest-of-k-scores
2210-find-target-indices-after-sorting-array
2502-sort-the-people
3471-minimum-average-of-smallest-and-largest-elements

Matrix

1396-count-servers-that-communicate
2132-convert-1d-array-into-2d-array

Simulation

0415-add-strings
0682-baseball-game
1505-create-target-array-in-the-given-order
1708-design-parking-system
2132-convert-1d-array-into-2d-array
2692-take-gifts-from-the-richest-pile
2800-minimum-string-length-after-removing-substrings
3447-clear-digits
3555-final-array-state-after-k-multiplication-operations-i

Divide and Conquer

0191-number-of-1-bits
0654-maximum-binary-tree

Stack

0225-implement-stack-using-queues
0654-maximum-binary-tree
0682-baseball-game
1050-construct-binary-search-tree-from-preorder-traversal
1570-final-prices-with-a-special-discount-in-a-shop
1720-crawler-log-folder
2800-minimum-string-length-after-removing-substrings
3447-clear-digits

Monotonic Stack

0654-maximum-binary-tree
1050-construct-binary-search-tree-from-preorder-traversal
1570-final-prices-with-a-special-discount-in-a-shop

Queue

0225-implement-stack-using-queues
0387-first-unique-character-in-a-string

Counting

0387-first-unique-character-in-a-string
0621-task-scheduler
0920-uncommon-words-from-two-sentences
1396-count-servers-that-communicate
1708-design-parking-system
1786-count-the-number-of-consistent-strings
1915-check-if-one-string-swap-can-make-strings-equal
2163-kth-distinct-string-in-an-array

Depth-First Search

0098-validate-binary-search-tree
0530-minimum-absolute-difference-in-bst
1243-sum-of-nodes-with-even-valued-grandparent
1396-count-servers-that-communicate
1544-count-good-nodes-in-binary-tree
2347-count-nodes-equal-to-average-of-subtree

Breadth-First Search

0530-minimum-absolute-difference-in-bst
1243-sum-of-nodes-with-even-valued-grandparent
1396-count-servers-that-communicate
1544-count-good-nodes-in-binary-tree

Trie

0648-replace-words
3193-maximum-strong-pair-xor-i
3309-count-prefix-and-suffix-pairs-i

Sliding Window

0187-repeated-dna-sequences
2112-minimum-difference-between-highest-and-lowest-of-k-scores
3193-maximum-strong-pair-xor-i
3380-shortest-subarray-with-or-at-least-k-ii

Linked List

0083-remove-duplicates-from-sorted-list

Dynamic Programming

0070-climbing-stairs
0435-non-overlapping-intervals
0930-all-possible-full-binary-trees
1362-airplane-seat-assignment-probability

Brainteaser

0292-nim-game
0319-bulb-switcher
1362-airplane-seat-assignment-probability

Probability and Statistics

1362-airplane-seat-assignment-probability

Game Theory

0292-nim-game

Recursion

0050-powx-n
0326-power-of-three
0930-all-possible-full-binary-trees

Number Theory

1585-the-kth-factor-of-n
2106-find-greatest-common-divisor-of-array

Enumeration

2122-count-special-quadruplets

Memoization

0070-climbing-stairs
0930-all-possible-full-binary-trees

Two Pointers

0283-move-zeroes
0345-reverse-vowels-of-a-string
0917-boats-to-save-people
1468-check-if-n-and-its-double-exist
3471-minimum-average-of-smallest-and-largest-elements

Rolling Hash

0187-repeated-dna-sequences
3309-count-prefix-and-suffix-pairs-i

Hash Function

0187-repeated-dna-sequences
3309-count-prefix-and-suffix-pairs-i

String Matching

0812-rotate-string
1524-string-matching-in-an-array
2292-counting-words-with-a-given-prefix
3309-count-prefix-and-suffix-pairs-i

Prefix Sum

1537-maximum-score-after-splitting-a-string
1693-sum-of-all-odd-length-subarrays
1895-minimum-number-of-operations-to-move-all-balls-to-each-box

Concurrency

1203-print-in-order
1340-the-dining-philosophers

Union Find

1396-count-servers-that-communicate

About

This repository contains solutions for LeetCode Problems

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages