Skip to content

Welcome to the LeetCode Practice Repository! πŸš€ Dive into a variety of coding challenges across topics like Arrays, Strings, Trees, and more.

Notifications You must be signed in to change notification settings

AshimaSingh0610/LeetCode-Qs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Logo

Status GitHub Issues GitHub Pull Requests

πŸ“š LeetCode Practice Repository πŸš€

Welcome to the LeetCode Practice Repository! This repository is dedicated to practicing and mastering a wide range of LeetCode problems, spanning various topics and difficulty levels. Whether you're preparing for coding interviews or aiming to sharpen your algorithmic skills, you'll find valuable resources here.

πŸš€ What You’ll Find Here

  • πŸ” Diverse Problem Set: A growing collection of problems categorized by topics such as Arrays, Strings, Trees, Graphs, and more.
  • 🧠 Practice Challenges: Practical coding challenges designed to enhance problem-solving skills and prepare for technical interviews.
  • πŸ“ˆ Solutions & Explanations: Implementations of problems with detailed explanations, including time and space complexity analyses.
  • πŸ’¬ Ongoing Development: The repository is continuously updated with new problems, techniques, and solutions.

πŸ—‚οΈ Repository Overview

Here's what’s currently available in the repository:

πŸ”’ Math

πŸ’‘ Dynamic Programming

🌲 Tree

πŸ”— Graph

πŸ—οΈ Topological Sort

✨ Combinatorics

πŸ› οΈ Future Plans

  • 🌟 Comprehensive Coverage: We plan to cover more LeetCode problems across a wider range of topics and difficulty levels.
  • πŸ”„ Continuous Updates: Regular updates will be made to include new problems, solutions, and improvements.
  • πŸ”§ Community Contributions: We welcome contributions from the community to enhance the repository further.

LeetCode Topics

Math

0264-ugly-number-ii
0273-integer-to-english-words
0335-self-crossing
0381-insert-delete-getrandom-o1-duplicates-allowed
0458-poor-pigs
0479-largest-palindrome-product
0483-smallest-good-base
0564-find-the-closest-palindrome
0587-erect-the-fence
0592-fraction-addition-and-subtraction
0650-2-keys-keyboard
0870-magic-squares-in-grid
1240-stone-game-ii
1313-count-ways-to-build-rooms-in-an-ant-colony
2155-find-missing-observations
2716-prime-subtraction-operation
2903-insert-greatest-common-divisors-in-linked-list

Dynamic Programming

0005-longest-palindromic-substring
0053-maximum-subarray
0121-best-time-to-buy-and-sell-stock
0122-best-time-to-buy-and-sell-stock-ii
0264-ugly-number-ii
0354-russian-doll-envelopes
0403-frog-jump
0410-split-array-largest-sum
0446-arithmetic-slices-ii-subsequence
0458-poor-pigs
0466-count-the-repetitions
0488-zuma-game
0546-remove-boxes
0552-student-attendance-record-ii
0600-non-negative-integers-without-consecutive-ones
0629-k-inverse-pairs-array
0650-2-keys-keyboard
0664-strange-printer
1240-stone-game-ii
1313-count-ways-to-build-rooms-in-an-ant-colony
1766-minimum-number-of-removals-to-make-mountain-array
2067-maximum-number-of-points-with-cost

Tree

0145-binary-tree-postorder-traversal
0776-n-ary-tree-postorder-traversal
0789-kth-largest-element-in-a-stream
0988-flip-equivalent-binary-trees
1313-count-ways-to-build-rooms-in-an-ant-colony
2646-kth-largest-sum-in-a-binary-tree
2677-cousins-in-binary-tree-ii

Graph

0332-reconstruct-itinerary
0984-most-stones-removed-with-same-row-or-column
1313-count-ways-to-build-rooms-in-an-ant-colony
1325-path-with-maximum-probability
2803-modify-graph-edge-weights

Topological Sort

1313-count-ways-to-build-rooms-in-an-ant-colony

Combinatorics

0458-poor-pigs
1313-count-ways-to-build-rooms-in-an-ant-colony

String

0003-longest-substring-without-repeating-characters
0005-longest-palindromic-substring
0006-zigzag-conversion
0008-string-to-integer-atoi
0065-valid-number
0214-shortest-palindrome
0273-integer-to-english-words
0336-palindrome-pairs
0420-strong-password-checker
0466-count-the-repetitions
0488-zuma-game
0564-find-the-closest-palindrome
0591-tag-validator
0592-fraction-addition-and-subtraction
0664-strange-printer
0920-uncommon-words-from-two-sentences
1473-find-the-longest-substring-containing-vowels-in-even-counts
2076-sum-of-digits-of-string-after-convert
3195-separate-black-and-white-balls

Recursion

0273-integer-to-english-words

Array

0040-combination-sum-ii
0053-maximum-subarray
0121-best-time-to-buy-and-sell-stock
0122-best-time-to-buy-and-sell-stock-ii
0330-patching-array
0335-self-crossing
0336-palindrome-pairs
0354-russian-doll-envelopes
0363-max-sum-of-rectangle-no-larger-than-k
0381-insert-delete-getrandom-o1-duplicates-allowed
0391-perfect-rectangle
0403-frog-jump
0407-trapping-rain-water-ii
0410-split-array-largest-sum
0446-arithmetic-slices-ii-subsequence
0480-sliding-window-median
0493-reverse-pairs
0502-ipo
0517-super-washing-machines
0546-remove-boxes
0587-erect-the-fence
0624-maximum-distance-in-arrays
0630-course-schedule-iii
0632-smallest-range-covering-elements-from-k-lists
0719-find-k-th-smallest-pair-distance
0870-magic-squares-in-grid
0890-lemonade-change
0906-walking-robot-simulation
0921-spiral-matrix-iii
0999-regions-cut-by-slashes
1240-stone-game-ii
1256-rank-transform-of-an-array
1325-path-with-maximum-probability
1497-design-a-stack-with-increment-operation
1620-check-if-array-pairs-are-divisible-by-k
1691-minimum-number-of-days-to-disconnect-island
1694-make-sum-divisible-by-p
1766-minimum-number-of-removals-to-make-mountain-array
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
2411-spiral-matrix-iv
2581-divide-players-into-teams-of-equal-skill
2616-maximal-score-after-applying-k-operations
2716-prime-subtraction-operation
3380-shortest-subarray-with-or-at-least-k-ii

Greedy

0122-best-time-to-buy-and-sell-stock-ii
0330-patching-array
0410-split-array-largest-sum
0420-strong-password-checker
0502-ipo
0517-super-washing-machines
0624-maximum-distance-in-arrays
0630-course-schedule-iii
0632-smallest-range-covering-elements-from-k-lists
0890-lemonade-change
1766-minimum-number-of-removals-to-make-mountain-array
2616-maximal-score-after-applying-k-operations
2716-prime-subtraction-operation
3195-separate-black-and-white-balls

Depth-First Search

0145-binary-tree-postorder-traversal
0332-reconstruct-itinerary
0776-n-ary-tree-postorder-traversal
0984-most-stones-removed-with-same-row-or-column
0988-flip-equivalent-binary-trees
0999-regions-cut-by-slashes
1691-minimum-number-of-days-to-disconnect-island
2035-count-sub-islands
2677-cousins-in-binary-tree-ii

Eulerian Circuit

0332-reconstruct-itinerary

Matrix

0363-max-sum-of-rectangle-no-larger-than-k
0407-trapping-rain-water-ii
0870-magic-squares-in-grid
0921-spiral-matrix-iii
0999-regions-cut-by-slashes
1691-minimum-number-of-days-to-disconnect-island
2035-count-sub-islands
2132-convert-1d-array-into-2d-array
2411-spiral-matrix-iv

Simulation

0592-fraction-addition-and-subtraction
0906-walking-robot-simulation
0921-spiral-matrix-iii
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
2411-spiral-matrix-iv

Geometry

0335-self-crossing
0587-erect-the-fence

Hash Table

0003-longest-substring-without-repeating-characters
0264-ugly-number-ii
0336-palindrome-pairs
0381-insert-delete-getrandom-o1-duplicates-allowed
0432-all-oone-data-structure
0480-sliding-window-median
0632-smallest-range-covering-elements-from-k-lists
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
1256-rank-transform-of-an-array
1473-find-the-longest-substring-containing-vowels-in-even-counts
1620-check-if-array-pairs-are-divisible-by-k
1694-make-sum-divisible-by-p
2581-divide-players-into-teams-of-equal-skill
2677-cousins-in-binary-tree-ii

Trie

0336-palindrome-pairs
0440-k-th-smallest-in-lexicographical-order

Binary Search

0354-russian-doll-envelopes
0363-max-sum-of-rectangle-no-larger-than-k
0410-split-array-largest-sum
0483-smallest-good-base
0493-reverse-pairs
0719-find-k-th-smallest-pair-distance
1766-minimum-number-of-removals-to-make-mountain-array
2006-find-the-student-that-will-replace-the-chalk
2716-prime-subtraction-operation

Sorting

0354-russian-doll-envelopes
0502-ipo
0630-course-schedule-iii
0632-smallest-range-covering-elements-from-k-lists
0719-find-k-th-smallest-pair-distance
1256-rank-transform-of-an-array
2581-divide-players-into-teams-of-equal-skill
2646-kth-largest-sum-in-a-binary-tree

Prefix Sum

0363-max-sum-of-rectangle-no-larger-than-k
0410-split-array-largest-sum
1240-stone-game-ii
1473-find-the-longest-substring-containing-vowels-in-even-counts
1694-make-sum-divisible-by-p
2006-find-the-student-that-will-replace-the-chalk

Ordered Set

0363-max-sum-of-rectangle-no-larger-than-k
0493-reverse-pairs

Breadth-First Search

0407-trapping-rain-water-ii
0488-zuma-game
0999-regions-cut-by-slashes
1691-minimum-number-of-days-to-disconnect-island
2035-count-sub-islands
2646-kth-largest-sum-in-a-binary-tree
2677-cousins-in-binary-tree-ii

Union Find

0984-most-stones-removed-with-same-row-or-column
0999-regions-cut-by-slashes
2035-count-sub-islands

Design

0381-insert-delete-getrandom-o1-duplicates-allowed
0432-all-oone-data-structure
0789-kth-largest-element-in-a-stream
1497-design-a-stack-with-increment-operation

Randomized

0381-insert-delete-getrandom-o1-duplicates-allowed

Line Sweep

0391-perfect-rectangle

Heap (Priority Queue)

0264-ugly-number-ii
0407-trapping-rain-water-ii
0420-strong-password-checker
0480-sliding-window-median
0502-ipo
0630-course-schedule-iii
0632-smallest-range-covering-elements-from-k-lists
0789-kth-largest-element-in-a-stream
1325-path-with-maximum-probability
2616-maximal-score-after-applying-k-operations
2803-modify-graph-edge-weights

Strongly Connected Component

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

Binary Search Tree

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

Binary Tree

0145-binary-tree-postorder-traversal
0789-kth-largest-element-in-a-stream
0988-flip-equivalent-binary-trees
2646-kth-largest-sum-in-a-binary-tree
2677-cousins-in-binary-tree-ii

Data Stream

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

Linked List

0432-all-oone-data-structure
2411-spiral-matrix-iv
2903-insert-greatest-common-divisors-in-linked-list

Doubly-Linked List

0432-all-oone-data-structure

Backtracking

0040-combination-sum-ii

Two Pointers

0005-longest-palindromic-substring
0719-find-k-th-smallest-pair-distance
2581-divide-players-into-teams-of-equal-skill
3195-separate-black-and-white-balls

Enumeration

0479-largest-palindrome-product

Sliding Window

0003-longest-substring-without-repeating-characters
0480-sliding-window-median
0632-smallest-range-covering-elements-from-k-lists
3380-shortest-subarray-with-or-at-least-k-ii

Game Theory

1240-stone-game-ii

Bit Manipulation

0476-number-complement
1473-find-the-longest-substring-containing-vowels-in-even-counts
3380-shortest-subarray-with-or-at-least-k-ii

Stack

0145-binary-tree-postorder-traversal
0488-zuma-game
0591-tag-validator
0776-n-ary-tree-postorder-traversal
1497-design-a-stack-with-increment-operation

Memoization

0488-zuma-game
0546-remove-boxes

Divide and Conquer

0053-maximum-subarray
0493-reverse-pairs

Binary Indexed Tree

0493-reverse-pairs

Segment Tree

0493-reverse-pairs

Merge Sort

0493-reverse-pairs

Shortest Path

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

Database

0601-human-traffic-of-stadium

Number Theory

2716-prime-subtraction-operation
2903-insert-greatest-common-divisors-in-linked-list

Counting

0920-uncommon-words-from-two-sentences
1620-check-if-array-pairs-are-divisible-by-k

Rolling Hash

0214-shortest-palindrome

String Matching

0214-shortest-palindrome

Hash Function

0214-shortest-palindrome

πŸ™Œ Contributing

We love contributions! Help us make this even better by contributing to the project. Your input is highly valued. πŸ€—

  • Fork the Project

  • Create your Feature Branch

(git checkout -b feature/AmazingFeature)
  • Commit your Changes
(git commit -m 'Add some AmazingFeature')
  • Push to the Branch
(git push origin feature/AmazingFeature)
  • Open a Pull Request
  1. Navigate to the "Pull Requests" tab in the repository.
  2. Click "New Pull Request".
  3. Select your feature branch and compare it with the main branch.
  4. Add a descriptive title and comments about your changes.
  5. Click "Create Pull Request".

✍️ Authors