leetcode
这页是一个使用Rust刷leetcode的尝试,最终的题解是在参考他人的方法之后我认为最优雅简洁的写法。优雅简洁的定义大概是少用unwrap, clone, 下标等有崩溃风险或者低效的操作,多使用Iterator等优雅简洁的方式。使用Github Actions定时同步账号题解,出于自动化考虑,只保留最后一个通过的题解,另外思路直接写在题解的注释之中。
lists
- Two Sum
- Add Two Numbers
- Longest Substring Without Repeating Characters
- Palindrome Number
- Container With Most Water
- Longest Common Prefix
- Valid Parentheses
- Merge Two Sorted Lists
- Generate Parentheses
- Merge k Sorted Lists
- Remove Duplicates from Sorted Array
- Remove Element
- Find the Index of the First Occurrence in a String
- Find First and Last Position of Element in Sorted Array
- Search Insert Position
- Trapping Rain Water
- Jump Game II
- Rotate Image
- Maximum Subarray
- Jump Game
- Merge Intervals
- Length of Last Word
- Sqrt(x)
- Climbing Stairs
- Remove Duplicates from Sorted List
- Merge Sorted Array
- Same Tree
- Symmetric Tree
- Binary Tree Level Order Traversal
- Binary Tree Zigzag Level Order Traversal
- Maximum Depth of Binary Tree
- Path Sum
- Pascal's Triangle
- Best Time to Buy and Sell Stock
- Best Time to Buy and Sell Stock II
- Valid Palindrome
- Single Number
- Single Number II
- Majority Element
- Best Time to Buy and Sell Stock with Cooldown
- Queue Reconstruction by Height
- Average of Levels in Binary Tree
- Valid Palindrome II
- Partition Labels
- Largest Perimeter Triangle
- Video Stitching
- Shortest Path in Binary Matrix
- Maximum Number of Words You Can Type
- Three Consecutive Odds
- Find N Unique Integers Sum up to Zero
- Convert Integer to the Sum of Two No-Zero Integers
- Avoid Flood in The City
- Water Bottles
- Calculate Money in Leetcode Bank
- Maximum Number of Removable Characters
- Final Value of Variable After Performing Operations
- Simple Bank System
- Largest Combination With Bitwise AND Greater Than Zero
- Replace Elements in an Array
- Successful Pairs of Spells and Potions
- Count Asterisks
- Maximum Difference by Remapping a Digit
- Divisible and Non-divisible Sums Difference
- Find Words Containing Character
- Water Bottles II
- Count Alternating Subarrays
- Taking Maximum Energy From the Mystic Dungeon
- Check If Digits Are Equal in String After Operations I
- Find Closest Person