Skip to content
/ leetcode Public

Collection of LeetCode solutions in TypeScript.

Notifications You must be signed in to change notification settings

furic/leetcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2,443 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

LeetCode Solutions in TypeScript

Ranking Contest Rating Problems Solved Solve Percentage TypeScript

A collection of LeetCode solutions implemented in TypeScript. This repository contains my solutions to various LeetCode problems, organized by problem ID and name.

πŸ“ Project Structure

Each problem is organized in its own directory following the format:

{problem_id}-{problem_name}/
β”œβ”€β”€ README.md                    # Problem description and constraints
β”œβ”€β”€ Solution.md                  # Solution explanation and approach
└── {problem_id}-{problem_name}.ts  # TypeScript solution implementation

πŸš€ How to Use

  1. Navigate to the problem directory you're interested in
  2. Read the README.md for problem description and constraints
  3. Check the Solution.md for detailed solution explanation, approach, and complexity analysis
  4. Review the {problem_id}-{problem_name}.ts file for the TypeScript implementation

πŸ“ Current Solutions

πŸ“‹ Arrays
Prefix Sum & Subarray/Product Problems - [0713. Subarray Product Less Than K](./0713-subarray-product-less-than-k/) - [1590. Make Sum Divisible By P](./1590-make-sum-divisible-by-p/) - [2110. Number Of Smooth Descent Periods Of A Stock](./2110-number-of-smooth-descent-periods-of-a-stock/) - [2348. Number Of Zero Filled Subarrays](./2348-number-of-zero-filled-subarrays/) - [2483. Minimum Penalty For A Shop](./2483-minimum-penalty-for-a-shop/) - [3010. Divide An Array Into Subarrays With Minimum Cost I](./3010-divide-an-array-into-subarrays-with-minimum-cost-i/) - [3013. Divide An Array Into Subarrays With Minimum Cost Ii](./3013-divide-an-array-into-subarrays-with-minimum-cost-ii/) - [3318. Find X Sum Of All K Long Subarrays I](./3318-find-x-sum-of-all-k-long-subarrays-i/) - [3321. Find X Sum Of All K Long Subarrays Ii](./3321-find-x-sum-of-all-k-long-subarrays-ii/) - [3349. Adjacent Increasing Subarrays Detection I](./3349-adjacent-increasing-subarrays-detection-i/) - [3350. Adjacent Increasing Subarrays Detection Ii](./3350-adjacent-increasing-subarrays-detection-ii/) - [3381. Maximum Subarray Sum With Length Divisible By K](./3381-maximum-subarray-sum-with-length-divisible-by-k/) - [3539. Find Sum of Array Product of Magical Sequences](./3539-find-sum-of-array-product-of-magical-sequences/) - [3542. Minimum Operations to Convert All Elements to Zero](./3542-minimum-operations-to-convert-all-elements-to-zero/) - [3587. Minimum Adjacent Swaps To Alternate Parity](./3587-minimum-adjacent-swaps-to-alternate-parity/) - [3599. Partition Array To Minimize Xor](./3599-partition-array-to-minimize-xor/) - [3689. Maximum Total Subarray Value I](./3689-maximum-total-subarray-value-i/) - [3719. Longest Balanced Subarray I](./3719-longest-balanced-subarray-i/) - [3748. Count Stable Subarrays](./3748-count-stable-subarrays/) - [3768. Minimum Inversion Count In Subarrays Of Fixed Length](./3768-minimum-inversion-count-in-subarrays-of-fixed-length/) - [3788. Maximum Score Of A Split](./3788-maximum-score-of-a-split/) - [3795. Minimum Subarray Length With Distinct Sum At Least K](./3795-minimum-subarray-length-with-distinct-sum-at-least-k/) - [3803. Count Residue Prefixes](./3803-count-residue-prefixes/) - [3804. Number Of Centered Subarrays](./3804-number-of-centered-subarrays/) - [3835. Count Subarrays With Cost Less Than Or Equal To K](./3835-count-subarrays-with-cost-less-than-or-equal-to-k/)
Sorting, Pairing & Removal - [0014. Longest Common Prefix](./0014-longest-common-prefix/) - [0026. Remove Duplicates From Sorted Array](./0026-remove-duplicates-from-sorted-array/) - [0049. Group Anagrams](./0049-group-anagrams/) - [0073. Set Matrix Zeroes](./0073-set-matrix-zeroes/) - [0075. Sort Colors](./0075-sort-colors/) - [0744. Find Smallest Letter Greater Than Target](./0744-find-smallest-letter-greater-than-target/) - [0757. Set Intersection Size At Least Two](./0757-set-intersection-size-at-least-two/) - [0869. Reordered Power Of 2](./0869-reordered-power-of-2/) - [0944. Delete Columns To Make Sorted](./0944-delete-columns-to-make-sorted/) - [0955. Delete Columns To Make Sorted Ii](./0955-delete-columns-to-make-sorted-ii/) - [0976. Largest Perimeter Triangle](./0976-largest-perimeter-triangle/) - [1200. Minimum Absolute Difference](./1200-minimum-absolute-difference/) - [1233. Remove Sub Folders From The Filesystem](./1233-remove-sub-folders-from-the-filesystem/) - [1877. Minimize Maximum Pair Sum In Array](./1877-minimize-maximum-pair-sum-in-array/) - [1984. Minimum Difference Between Highest And Lowest Of K Scores](./1984-minimum-difference-between-highest-and-lowest-of-k-scores/) - [2014. Longest Subsequence Repeated K Times](./2014-longest-subsequence-repeated-k-times/) - [2054. Two Best Non Overlapping Events](./2054-two-best-non-overlapping-events/) - [2099. Find Subsequence Of Length K With The Largest Sum](./2099-find-subsequence-of-length-k-with-the-largest-sum/) - [2141. Maximum Running Time Of N Computers](./2141-maximum-running-time-of-n-computers/) - [2300. Successful Pairs Of Spells And Potions](./2300-successful-pairs-of-spells-and-potions/) - [2327. Number Of People Aware Of A Secret](./2327-number-of-people-aware-of-a-secret/) - [2402. Meeting Rooms Iii](./2402-meeting-rooms-iii/) - [2406. Divide Intervals Into Minimum Number Of Groups](./2406-divide-intervals-into-minimum-number-of-groups/) - [2410. Maximum Matching Of Players With Trainers](./2410-maximum-matching-of-players-with-trainers/) - [2616. Minimize The Maximum Difference Of Pairs](./2616-minimize-the-maximum-difference-of-pairs/) - [3074. Apple Redistribution Into Boxes](./3074-apple-redistribution-into-boxes/) - [3075. Maximize Happiness Of Selected Children](./3075-maximize-happiness-of-selected-children/) - [3362. Zero Array Transformation Iii](./3362-zero-array-transformation-iii/) - [3397. Maximum Number Of Distinct Elements After Operations](./3397-maximum-number-of-distinct-elements-after-operations/) - [3424. Minimum Cost To Make Arrays Identical](./3424-minimum-cost-to-make-arrays-identical/) - [3507. Minimum Pair Removal to Sort Array I](./3507-minimum-pair-removal-to-sort-array-i/) - [3510. Minimum Pair Removal to Sort Array II](./3510-minimum-pair-removal-to-sort-array-ii/) - [3536. Maximum Product of Two Digits](./3536-maximum-product-of-two-digits/) - [3538. Merge Operations For Minimum Travel Time](./3538-merge-operations-for-minimum-travel-time/) - [3551. Minimum Swaps To Sort By Digit Sum](./3551-minimum-swaps-to-sort-by-digit-sum/) - [3572. Maximize Ysum By Picking A Triplet Of Distinct Xvalues](./3572-maximize-ysum-by-picking-a-triplet-of-distinct-xvalues/) - [3644. Maximum K To Sort A Permutation](./3644-maximum-k-to-sort-a-permutation/) - [3649. Number Of Perfect Pairs](./3649-number-of-perfect-pairs/) - [3668. Restore Finishing Order](./3668-restore-finishing-order/) - [3727. Maximum Alternating Sum Of Squares](./3727-maximum-alternating-sum-of-squares/) - [3767. Maximize Points After Choosing K Tasks](./3767-maximize-points-after-choosing-k-tasks/) - [3774. Absolute Difference Between Maximum And Minimum K Elements](./3774-absolute-difference-between-maximum-and-minimum-k-elements/) - [3814. Maximum Capacity Within Budget](./3814-maximum-capacity-within-budget/) - [3836. Maximum Score Using Exactly K Pairs](./3836-maximum-score-using-exactly-k-pairs/)
Counting, Frequency & Miscellaneous
Counting & Frequency
Operations & Transformations
General Array Problems
General Array Problems
Matrix Problems - [0036. Valid Sudoku](./0036-valid-sudoku/) - [0054. Spiral Matrix](./0054-spiral-matrix/) - [0059. Spiral Matrix II](./0059-spiral-matrix-ii/) - [0073. Set Matrix Zeroes](./0073-set-matrix-zeroes/) - [0085. Maximal Rectangle](./0085-maximal-rectangle/) - [0200. Number Of Islands](./0200-number-of-islands/) - [0407. Trapping Rain Water Ii](./0407-trapping-rain-water-ii/) - [0417. Pacific Atlantic Water Flow](./0417-pacific-atlantic-water-flow/) - [0778. Swim In Rising Water](./0778-swim-in-rising-water/) - [0885. Spiral Matrix III](./0885-spiral-matrix-iii/) - [1292. Maximum Side Length Of A Square With Sum Less Than Or Equal To Threshold](./1292-maximum-side-length-of-a-square-with-sum-less-than-or-equal-to-threshold/) - [1895. Largest Magic Square](./1895-largest-magic-square/) - [1975. Maximum Matrix Sum](./1975-maximum-matrix-sum/) - [2257. Count Unguarded Cells In The Grid](./2257-count-unguarded-cells-in-the-grid/) - [2326. Spiral Matrix IV](./2326-spiral-matrix-iv/) - [2435. Paths In Matrix Whose Sum Is Divisible By K](./2435-paths-in-matrix-whose-sum-is-divisible-by-k/) - [2536. Increment Submatrices By One](./2536-increment-submatrices-by-one/) - [3000. Maximum Area Of Longest Diagonal Rectangle](./3000-maximum-area-of-longest-diagonal-rectangle/) - [3047. Find The Largest Area Of Square Inside Two Rectangles](./3047-find-the-largest-area-of-square-inside-two-rectangles/) - [3195. Find The Minimum Area To Cover All Ones I](./3195-find-the-minimum-area-to-cover-all-ones-i/) - [3341. Find Minimum Time To Reach Last Room I](./3341-find-minimum-time-to-reach-last-room-i/) - [3342. Find Minimum Time To Reach Last Room Ii](./3342-find-minimum-time-to-reach-last-room-ii/) - [3363. Find The Maximum Number Of Fruits Collected](./3363-find-the-maximum-number-of-fruits-collected/) - [3426. Manhattan Distances Of All Arrangements Of Pieces](./3426-manhattan-distances-of-all-arrangements-of-pieces/) - [3446. Sort Matrix by Diagonals](./3446-sort-matrix-by-diagonals/) - [3453. Separate Squares I](./3453-separate-squares-i/) - [3454. Separate Squares Ii](./3454-separate-squares-ii/) - [3459. Length Of Longest V Shaped Diagonal Segment](./3459-length-of-longest-v-shaped-diagonal-segment/) - [3529. Count Cells In Overlapping Horizontal And Vertical Substrings](./3529-count-cells-in-overlapping-horizontal-and-vertical-substrings/) - [3537. Fill A Special Grid](./3537-fill-a-special-grid/) - [3552. Grid Teleportation Traversal](./3552-grid-teleportation-traversal/) - [3567. Minimum Absolute Difference In Sliding Submatrix](./3567-minimum-absolute-difference-in-sliding-submatrix/) - [3603. Minimum Cost Path With Alternating Directions Ii](./3603-minimum-cost-path-with-alternating-directions-ii/) - [3623. Count Number Of Trapezoids I](./3623-count-number-of-trapezoids-i/) - [3625. Count Number Of Trapezoids Ii](./3625-count-number-of-trapezoids-ii/) - [3643. Flip Square Submatrix Vertically](./3643-flip-square-submatrix-vertically/)
Two-Pointer & Sliding Window - [0011. Container With Most Water](./0011-container-with-most-water/) - [0013. Roman To Integer](./0013-roman-to-integer/) - [0015. 3Sum](./0015-3sum/) - [0120. Triangle](./0120-triangle/) - [0135. Candy](./0135-candy/) - [0165. Compare Version Numbers](./0165-compare-version-numbers/) - [0326. Power Of Three](./0326-power-of-three/) - [0837. New 21 Game](./0837-new-21-game/) - [0904. Fruit Into Baskets](./0904-fruit-into-baskets/) - [1249. Minimum Remove to Make Valid Parentheses](./1249-minimum-remove-to-make-valid-parentheses/) - [1353. Maximum Number Of Events That Can Be Attended](./1353-maximum-number-of-events-that-can-be-attended/) - [1493. Longest Subarray Of 1s After Deleting One Element](./1493-longest-subarray-of-1s-after-deleting-one-element/) - [1498. Number Of Subsequences That Satisfy The Given Sum Condition](./1498-number-of-subsequences-that-satisfy-the-given-sum-condition/) - [1695. Maximum Erasure Value](./1695-maximum-erasure-value/) - [1751. Maximum Number Of Events That Can Be Attended Ii](./1751-maximum-number-of-events-that-can-be-attended-ii/) - [2040. Kth Smallest Product Of Two Sorted Arrays](./2040-kth-smallest-product-of-two-sorted-arrays/) - [2163. Minimum Difference In Sums After Removal Of Elements](./2163-minimum-difference-in-sums-after-removal-of-elements/) - [2438. Range Product Queries Of Powers](./2438-range-product-queries-of-powers/) - [3021. Alice And Bob Playing Flower Game](./3021-alice-and-bob-playing-flower-game/) - [3027. Find The Number Of Ways To Place People Ii](./3027-find-the-number-of-ways-to-place-people-ii/) - [3197. Find The Minimum Area To Cover All Ones Ii](./3197-find-the-minimum-area-to-cover-all-ones-ii/) - [3439. Reschedule Meetings For Maximum Free Time I](./3439-reschedule-meetings-for-maximum-free-time-i/) - [3477. Fruits Into Baskets Ii](./3477-fruits-into-baskets-ii/) - [3479. Fruits Into Baskets Iii](./3479-fruits-into-baskets-iii/) - [3608. Minimum Time For K Connected Components](./3608-minimum-time-for-k-connected-components/) - [3690. Split And Merge Array Transformation](./3690-split-and-merge-array-transformation/) - [3698. Split Array With Minimum Difference](./3698-split-array-with-minimum-difference/) - [3727. Maximum Alternating Sum Of Squares](./3727-maximum-alternating-sum-of-squares/)
Dynamic Programming - [0474. Ones And Zeroes](./0474-ones-and-zeroes/) - [0712. Minimum Ascii Delete Sum For Two Strings](./0712-minimum-ascii-delete-sum-for-two-strings/) - [0756. Pyramid Transition Matrix](./0756-pyramid-transition-matrix/) - [0790. Domino and Tromino Tiling](./0790-domino-and-tromino-tiling/) - [0799. Champagne Tower](./0799-champagne-tower/) - [0960. Delete Columns To Make Sorted Iii](./0960-delete-columns-to-make-sorted-iii/) - [1039. Minimum Score Triangulation Of Polygon](./1039-minimum-score-triangulation-of-polygon/) - [1125. Smallest Sufficient Team](./1125-smallest-sufficient-team/) - [1262. Greatest Sum Divisible By Three](./1262-greatest-sum-divisible-by-three/) - [1411. Number Of Ways To Paint N 3 Grid](./1411-number-of-ways-to-paint-n-3-grid/) - [1432. Max Difference You Can Get From Changing an Integer](./1432-max-difference-you-can-get-from-changing-an-integer/) - [1458. Max Dot Product Of Two Subsequences](./1458-max-dot-product-of-two-subsequences/) - [1653. Minimum Deletions To Make String Balanced](./1653-minimum-deletions-to-make-string-balanced/) - [2787. Ways To Express An Integer As Sum Of Powers](./2787-ways-to-express-an-integer-as-sum-of-powers/) - [2826. Sorting Three Groups](./2826-sorting-three-groups/) - [3202. Find The Maximum Length Of Valid Subsequence Ii](./3202-find-the-maximum-length-of-valid-subsequence-ii/) - [3573. Best Time To Buy And Sell Stock V](./3573-best-time-to-buy-and-sell-stock-v/) - [3592. Inverse Coin Change](./3592-inverse-coin-change/) - [3652. Best Time To Buy And Sell Stock Using Strategy](./3652-best-time-to-buy-and-sell-stock-using-strategy/) - [3693. Climbing Stairs Ii](./3693-climbing-stairs-ii/) - [3751. Total Waviness Of Numbers In Range I](./3751-total-waviness-of-numbers-in-range-i/) - [3771. Total Score Of Dungeon Runs](./3771-total-score-of-dungeon-runs/) - [3789. Minimum Cost To Acquire Required Items](./3789-minimum-cost-to-acquire-required-items/) - [3791. Number Of Balanced Integers In A Range](./3791-number-of-balanced-integers-in-a-range/) - [3796. Find Maximum Value In A Constrained Sequence](./3796-find-maximum-value-in-a-constrained-sequence/) - [3797. Count Routes To Climb A Rectangular Grid](./3797-count-routes-to-climb-a-rectangular-grid/) - [3800. Minimum Cost To Make Two Binary Strings Equal](./3800-minimum-cost-to-make-two-binary-strings-equal/) - [3801. Minimum Cost To Merge Sorted Lists](./3801-minimum-cost-to-merge-sorted-lists/) - [3811. Number Of Alternating Xor Partitions](./3811-number-of-alternating-xor-partitions/) - [3825. Longest Strictly Increasing Subsequence With Non Zero Bitwise And](./3825-longest-strictly-increasing-subsequence-with-non-zero-bitwise-and/) - [3826. Minimum Partition Score](./3826-minimum-partition-score/) - [3840. House Robber V](./3840-house-robber-v/)
πŸ”€ Strings
Lexicographical & Ordering
String Transformations & Operations
Palindromes & Subsequences
Vowels & Character Patterns
String Matching & Substrings
Digit & Number Strings
String Games & Encoding
File & Path Operations
Validation & Parsing
Strings & Palindromes
🌳 Trees & Graphs
πŸ” Hash Tables & Dictionaries
πŸ”’ Bit Manipulation
πŸ”’ Pure Math
πŸ’Ύ System Design
πŸ“Š SQL

🀝 Contributing

While this is primarily my personal collection of solutions, I welcome any suggestions or improvements. Feel free to:

  • Report bugs or issues
  • Suggest optimizations
  • Share alternative solutions

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


Solutions are automatically synced using LeetHub 3.0, a Chrome extension that automatically pushes your LeetCode solutions to GitHub.

About

Collection of LeetCode solutions in TypeScript.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •