This repository contains solutions for LeetCode problems implemented in TypeScript (JavaScript) and Python.
The purpose of this repository is to provide clear, efficient, and well-explained solutions for various LeetCode problems. Each solution is accompanied by detailed comments that explain the logic and approach used to solve the problem.
- TypeScript
- JavaScript
- Python
- Java
Each problem has its own directory, and within each problem's directory, you will find a solution file for both TypeScript and JavaScript. Feel free to explore and use these solutions to understand and solve LeetCode problems more effectively.
Contributions are welcome! If you have a better solution or a solution to a problem that is not currently in the repository, feel free to make a pull request.
| Problem Name | Difficulty |
|---|---|
| 0486-predict-the-winner | Medium |
| 1545-find-kth-bit-in-nth-binary-string | Medium |
| 3483-unique-3-digit-even-numbers | Easy |
| Problem Name | Difficulty |
|---|---|
| 0022-generate-parentheses | Medium |
| 1096-brace-expansion-ii | Hard |
| 1415-the-k-th-lexicographical-string-of-all-happy-strings-of-length-n | Medium |
| 1980-find-unique-binary-string | Medium |
| 3348-smallest-divisible-digit-product-ii | Hard |
| Problem Name | Difficulty |
|---|---|
| 2492-minimum-score-of-a-path-between-two-cities | Medium |
| 2685-count-the-number-of-complete-components | Medium |
| 3286-find-a-safe-walk-through-a-grid | Medium |
| 3310-remove-methods-from-project | Medium |
| 3532-path-existence-queries-in-a-graph-i | Medium |
| 3534-path-existence-queries-in-a-graph-ii | Hard |
| 3600-maximize-spanning-tree-stability-with-upgrades | Hard |
| 3620-network-recovery-pathways | Hard |
| Problem Name | Difficulty |
|---|---|
| 3600-maximize-spanning-tree-stability-with-upgrades | Hard |
| Problem Name | Difficulty |
|---|---|
| 1464-maximum-product-of-two-elements-in-an-array | Easy |
| 1878-get-biggest-three-rhombus-sums-in-a-grid | Medium |
| 2812-find-the-safest-path-in-a-grid | Medium |
| 3286-find-a-safe-walk-through-a-grid | Medium |
| 3296-minimum-number-of-seconds-to-make-mountain-height-zero | Medium |
| 3620-network-recovery-pathways | Hard |
| 3691-maximum-total-subarray-value-ii | Hard |
| Problem Name | Difficulty |
|---|---|
| 1622-fancy-sequence | Hard |
| 2069-walking-robot-simulation-ii | Medium |
| Problem Name | Difficulty |
|---|---|
| 1622-fancy-sequence | Hard |
| 2213-longest-substring-of-one-repeating-character | Hard |
| 3161-block-placement-queries | Hard |
| 3501-maximize-active-section-with-trade-ii | Hard |
| 3525-find-x-value-of-array-ii | Hard |
| 3691-maximum-total-subarray-value-ii | Hard |
| 3737-count-subarrays-with-majority-element-i | Medium |
| 3739-count-subarrays-with-majority-element-ii | Hard |
| Problem Name | Difficulty |
|---|---|
| 3474-lexicographically-smallest-generated-string | Hard |
| Problem Name | Difficulty |
|---|---|
| 0020-valid-parentheses | Easy |
| 1081-smallest-subsequence-of-distinct-characters | Medium |
| 1096-brace-expansion-ii | Hard |
| 1111-maximum-nesting-depth-of-two-valid-parentheses-strings | Medium |
| 1190-reverse-substrings-between-each-pair-of-parentheses | Medium |
| 1614-maximum-nesting-depth-of-the-parentheses | Easy |
| 2751-robot-collisions | Hard |
| Problem Name | Difficulty |
|---|---|
| 3653-xor-after-range-multiplication-queries-i | Medium |
| 3655-xor-after-range-multiplication-queries-ii | Hard |
| 3737-count-subarrays-with-majority-element-i | Medium |
| 3739-count-subarrays-with-majority-element-ii | Hard |
| Problem Name | Difficulty |
|---|---|
| 1306-jump-game-iii | Medium |
| 1391-check-if-there-is-a-valid-path-in-a-grid | Medium |
| 1559-detect-cycles-in-2d-grid | Medium |
| 1722-minimize-hamming-distance-after-swap-operations | Medium |
| 2265-count-nodes-equal-to-average-of-subtree | Medium |
| 2492-minimum-score-of-a-path-between-two-cities | Medium |
| 2685-count-the-number-of-complete-components | Medium |
| 3310-remove-methods-from-project | Medium |
| 3558-number-of-ways-to-assign-edge-weights-i | Medium |
| 3559-number-of-ways-to-assign-edge-weights-ii | Hard |
| Problem Name | Difficulty |
|---|---|
| 2452-words-within-two-edits-of-dictionary | Medium |
| 3043-find-the-length-of-the-longest-common-prefix | Medium |
| 3093-longest-common-suffix-queries | Hard |
| Problem Name | Difficulty |
|---|---|
| 1189-maximum-number-of-balloons | Easy |
| 2029-stone-game-ix | Medium |
| 2833-furthest-point-from-origin | Easy |
| 3016-minimum-number-of-pushes-to-type-word-ii | Medium |
| 3312-sorted-gcd-pair-queries | Hard |
| 3518-smallest-palindromic-rearrangement-ii | Hard |
| 3720-lexicographically-smallest-permutation-greater-than-target | Medium |
| 3737-count-subarrays-with-majority-element-i | Medium |
| Problem Name | Difficulty |
|---|---|
| 0836-rectangle-overlap | Easy |
| 1401-circle-and-rectangle-overlapping | Medium |
| 3464-maximize-the-distance-between-points-on-a-square | Hard |
| Problem Name | Difficulty |
|---|---|
| 1096-brace-expansion-ii | Hard |
| 1306-jump-game-iii | Medium |
| 1345-jump-game-iv | Hard |
| 1391-check-if-there-is-a-valid-path-in-a-grid | Medium |
| 1559-detect-cycles-in-2d-grid | Medium |
| 2492-minimum-score-of-a-path-between-two-cities | Medium |
| 2685-count-the-number-of-complete-components | Medium |
| 2812-find-the-safest-path-in-a-grid | Medium |
| 3286-find-a-safe-walk-through-a-grid | Medium |
| 3310-remove-methods-from-project | Medium |
| 3568-minimum-moves-to-clean-the-classroom | Medium |
| 3629-minimum-jumps-to-reach-end-via-prime-teleportation | Medium |
| Problem Name | Difficulty |
|---|---|
| 0061-rotate-list | Medium |
| 2058-find-the-minimum-and-maximum-number-of-nodes-between-critical-points | Medium |
| 2095-delete-the-middle-node-of-a-linked-list | Medium |
| Problem Name | Difficulty |
|---|---|
| 3161-block-placement-queries | Hard |
| Problem Name | Difficulty |
|---|---|
| 2196-create-binary-tree-from-descriptions | Medium |
| 2265-count-nodes-equal-to-average-of-subtree | Medium |
| 3558-number-of-ways-to-assign-edge-weights-i | Medium |
| 3559-number-of-ways-to-assign-edge-weights-ii | Hard |
| Problem Name | Difficulty |
|---|---|
| 2196-create-binary-tree-from-descriptions | Medium |
| 2265-count-nodes-equal-to-average-of-subtree | Medium |
| Problem Name | Difficulty |
|---|---|
| 3737-count-subarrays-with-majority-element-i | Medium |
| 3739-count-subarrays-with-majority-element-ii | Hard |
| Problem Name | Difficulty |
|---|---|
| 3286-find-a-safe-walk-through-a-grid | Medium |
| 3620-network-recovery-pathways | Hard |
| Problem Name | Difficulty |
|---|---|
| 3620-network-recovery-pathways | Hard |
| Problem Name | Difficulty |
|---|---|
| 1621-number-of-sets-of-k-non-overlapping-line-segments | Medium |
| 3116-kth-smallest-amount-with-single-denomination-combination | Hard |
| 3312-sorted-gcd-pair-queries | Hard |
| 3518-smallest-palindromic-rearrangement-ii | Hard |
| Problem Name | Difficulty |
|---|---|
| 1081-smallest-subsequence-of-distinct-characters | Medium |
| Problem Name | Difficulty |
|---|---|
| 3517-smallest-palindromic-rearrangement-i | Medium |
| Problem Name | Difficulty |
|---|---|
| 0486-predict-the-winner | Medium |
| 0877-stone-game | Medium |
| 1140-stone-game-ii | Medium |
| 1406-stone-game-iii | Hard |
| 1510-stone-game-iv | Hard |
| 1563-stone-game-v | Hard |
| 1872-stone-game-viii | Hard |
| 1927-sum-game | Medium |
| 2029-stone-game-ix | Medium |
| Problem Name | Difficulty |
|---|---|
| 1140-stone-game-ii | Medium |
| 1510-stone-game-iv | Hard |
| 1872-stone-game-viii | Hard |
| 2029-stone-game-ix | Medium |
| Problem Name | Difficulty |
|---|---|
| 1140-stone-game-ii | Medium |
| 1510-stone-game-iv | Hard |
| 1872-stone-game-viii | Hard |
| 2029-stone-game-ix | Medium |
| Problem Name | Difficulty |
|---|---|
| 1510-stone-game-iv | Hard |
| 2029-stone-game-ix | Medium |
| Problem Name | Difficulty |
|---|---|
| 1510-stone-game-iv | Hard |
| Problem Name | Difficulty |
|---|---|
| 2213-longest-substring-of-one-repeating-character | Hard |