This repository contains LeetCode problem solutions implemented in Rust.
- 1. Two Sum
- 9. Palindrome Number
- 13. Roman to Integer
- 14. Longest Common Prefix
- 20. Valid Parentheses
- 21. Merge Two Sorted Lists
- 26. Remove Duplicates from Sorted Array
- 27. Remove Element
- 28. Implement strStr()
- 35. Search Insert Position
- 118. Pascal's Triangle
- 231. Power of Two
- 326. Power of Three
- 342. Power of Four
- 594. Longest Harmonious Subsequence
- 812. Largest Triangle Area
- 976. Largest Perimeter Triangle
- 1290. Convert Binary Number in a Linked List to Integer
- 1304. Find N Unique Integers Sum up to Zero
- 1317. Convert Integer to the Sum of Two No-Zero Integers
- 1323. Maximum 69 Number
- 1394. Find Lucky Integer in an Array
- 1935. Maximum Number of Words You Can Type
- 1957. Delete Characters to Make Fancy String
- 2099. Find Subsequence of Length K With the Largest Sum
- 2210. Count Hills and Valleys in an Array
- 2264. Largest 3-Same-Digit Number in String
- 3000. Maximum Area of Longest Diagonal Rectangle
- 3005. Count Elements With Maximum Frequency
- 3136. Valid Word
- 3304. Find the K-th Character in String Game I
- 3330. Find the Original Typed String I
- 3477. Fruits Into Baskets II
- 3487. Maximum Unique Subarray Sum After Deletion
- 3516. Find Closest Person
- 3541. Find Most Frequent Vowel and Consonant
- 2. Add Two Numbers
- 3. Longest Substring Without Repeating Characters
- 5. Longest Palindromic Substring
- 6. Zigzag Conversion
- 7. Reverse Integer
- 8. String to Integer (atoi)
- 11. Container With Most Water
- 12. Integer to Roman
- 15. 3Sum
- 16. 3Sum Closest
- 17. Letter Combinations of a Phone Number
- 18. 4Sum
- 19. Remove Nth Node From End of List
- 22. Generate Parentheses
- 24. Swap Nodes in Pairs
- 29. Divide Two Integers
- 31. Next Permutation
- 33. Search in Rotated Sorted Array
- 34. Find First and Last Position of Element in Sorted Array
- 36. Valid Sudoku
- 120. Triangle
- 165. Compare Version Numbers
- 166. Fraction to Recurring Decimal
- 498. Diagonal Traverse
- 611. Valid Triangle Number
- 808. Soup Servings
- 837. New 21 Game
- 869. Reordered Power of 2
- 898. Bitwise ORs of Subarrays
- 904. Fruit Into Baskets
- 912. Sort an Array
- 966. Vowel Spellchecker
- 1039. Minimum Score Triangulation of Polygon
- 1233. Remove Sub-Folders from the Filesystem
- 1277. Count Square Submatrices with All Ones
- 1353. Maximum Number of Events That Can Be Attended
- 1493. Longest Subarray of 1's After Deleting One Element
- 1498. Number of Subsequences That Satisfy the Given Sum Condition
- 1504. Count Submatrices With All Ones
- 1695. Maximum Erasure Value
- 1717. Maximum Score From Removing Substrings
- 1792. Maximum Average Pass Ratio
- 1865. Finding Pairs With a Certain Sum
- 2044. Count Number of Maximum Bitwise OR Subsets
- 2221. Find Triangular Sum of an Array
- 2327. Number of People Aware of a Secret
- 2348. Number of Zero-Filled Subarrays
- 2353. Design a Food Rating System
- 2410. Maximum Matching of Players With Trainers
- 2411. Smallest Subarrays With Maximum Bitwise OR
- 2419. Longest Subarray With Maximum Bitwise AND
- 2438. Range Product Queries of Powers
- 2749. Minimum Operations to Make the Integer Zero
- 2785. Sort Vowels in a String
- 2787. Ways to Express an Integer as Sum of Powers
- 3021. Alice and Bob Playing Flower Game
- 3025. Find the Number of Ways to Place People I
- 3195. Find the Minimum Area to Cover All Ones I
- 3201. Find the Maximum Length of Valid Subsequence I
- 3202. Find the Maximum Length of Valid Subsequence II
- 3227. Vowels Game in a String
- 3408. Design Task Manager
- 3439. Reschedule Meetings for Maximum Free Time I
- 3440. Reschedule Meetings for Maximum Free Time II
- 3446. Sort Matrix by Diagonals
- 3479. Fruits Into Baskets III
- 3484. Design Spreadsheet
- 3508. Implement Router
- 4. Median of Two Sorted Arrays
- 10. Regular Expression Matching
- 23. Merge k Sorted Lists
- 25. Reverse Nodes in k-Group
- 30. Substring with Concatenation of All Words
- 32. Longest Valid Parentheses
- 37. Sudoku Solver
- 679. 24 Game
- 1439. Find the Kth Smallest Sum of a Matrix With Sorted Rows
- 1751. Maximum Number of Events That Can Be Attended II
- 1900. The Earliest and Latest Rounds Where Players Compete
- 1912. Design Movie Rental System
- 1948. Delete Duplicate Folders in System
- 2106. Maximum Fruits Harvested After at Most K Steps
- 2163. Minimum Difference in Sums After Removal of Elements
- 2197. Replace Non-Coprime Numbers in Array
- 2322. Minimum Score After Removals on a Tree
- 2402. Meeting Rooms III
- 2561. Rearranging Fruits
- 3027. Find the Number of Ways to Place People II
- 3197. Find the Minimum Area to Cover All Ones II
- 3307. Find the K-th Character in String Game II
- 3333. Find the Original Typed String II
- 3363. Find the Maximum Number of Fruits Collected
- 3459. Length of Longest V-Shaped Diagonal Segment
- 3480. Maximize Subarrays After Removing One Conflicting Pair
- 3495. Minimum Operations to Make Array Elements Zero
# Run all tests
cargo test
# Run tests for a specific difficulty
cargo test easy
cargo test medium
cargo test hard
# Run a specific test
cargo test test_sort_array
tests/
├── easy/ # Easy difficulty problems
├── medium/ # Medium difficulty problems
├── hard/ # Hard difficulty problems
└── shared/ # Shared utilities
Each problem is implemented in its own file with comprehensive test cases to verify the solution correctness.