Skip to content

Orca-bit/leetcode-rust-1

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

  • problem number with 🔒 suffix need leetcode VIP to unlock
  • problem number with suffix is a bad solution(like leetcode#371 Python can't do bitwise add)

codeforces_solutions

Problem Solution
1A - Theatre Square Rust
4A - Watermelon Rust
71A - Way Too Long Words Rust
158A - Next Round Rust
231A - Team Rust

leetcode_solutions

# Problem Solutions Category/Comment
1 Two Sum Rust, Java bitwise
2 Add Two Numbers Rust, Java, Go linked_list
3 Longest Substring Without Repeating Char... Rust sliding_window
4 Median of Two Sorted Arrays Rust, Python binary_search
5 Longest Palindromic Substring Rust, Python manacher, suffix_array
6 ZigZag Conversion Rust
7 Reverse Integer Rust
8 String to Integer (atoi) Python
9 Palindromic Number Rust
10 Regular Expression Matching Python
11 Container With Most Water Rust
12 Integer to Roman Rust
13 Roman to Integer Rust
14 Longest Common Prefix Python
15 3Sum Python two_pointers, two_sum
16 3Sum Closest Python two_sum
17 Letter Combinations of a Phone Number Rust BFS
18 4Sum Python two_pointers, two_sum
19 Remove Nth Node From End of List Rust sliding_window
20 Valid Parentheses Python stack
21 Merge Two Sorted Lists Rust, Python
22 Generate Parentheses Python backtracking
23 Merge k Sorted Lists Python
24 Swap Nodes in Pairs Rust
26 Remove Duplicates from Sorted Array Rust
27 Remove Element Rust
28 Implement strStr() Rust, Python kmp, dfa
31 Next Permutation Python
33 Search in Rotated Sorted Array Python binary_search
34 Find First and Last Position of Element ... Rust
35 Search Insert Position Rust
36 Valid Sudoku Python
37 Soduku Solver Python
38 Count And Say Rust
39 Combination Sum Python, Rust
40 Combination Sum II Python, Rust
42 Trapping Rain Water Rust
44 Wildcard Matching Python
45 Jump Game II Rust greedy
46 Permutations Rust
47 Permutations II Rust
48 Rotate Image Rust
49 Group Anagrams Rust
50 Pow(x, n) Rust
51 N Queens Python, Rust
52 N Queens II Python, Rust
53 Maximum Subarray Python greedy, dp
54 Spiral Matrix Rust
55 Jump Game Python greedy, dp
58 Length of Last Word Rust
59 Spiral Matrix II Rust
60 Permutation Sequence Python
62 Unique Paths Rust, Go combination
63 Unique Paths II Python
64 Minimum Path Sum Python
65 Valid Number Rust
66 Plus One Rust
67 Add Binary C++
69 Sqrt(x) Rust
70 Climb Stairs Rust fibonacci
72 Edit Distance Rust
73 Set Matrix Zeroes Rust
74 Search a 2D Matrix Rust
75 Sort Colors Python three_pointers, partition_array
77 Combinations Rust
78 Subsets Rust
79 Word Search Python
81 Search in Rotated Sorted Array II Python binary_search
82 Remove Duplicates from Sorted List II C++
83 Remove Duplicates from Sorted List C++
86 Partition List Rust
88 Merge Sorted Array Rust, Python merge_sort
89 Gray Code Rust
90 Subsets II Python
91 Decode Ways Python
92 Reverse Linked List II Python
93 Restore IP Addresses Rust
94 Binary Tree Inorder Traversal Python DFS, stack
98 Validate Binary Search Tree Rust
99 Recover Binary Search Tree Python
100 Same Tree Rust
102 Binary Tree Level Order Traversal Rust, Python
103 Binary Tree Zigzag Level Order Traversal Rust
104 Maximum Depth of Binary Tree Rust
105 Construct Binary Tree from Preorder and Inorder Traversal Python DFS, stack
106 Construct Binary Tree from Inorder and Postorder Traversal Python DFS
107 Binary Tree Level Order Traversal II Rust
108 Convert Sorted Array to Binary Search Tree Python divide_and_conquer
109 Convert Sorted List to Binary Search Tree Python divide_and_conquer
110 Balanced Binary Tree Python divide_and_conquer
111 Minimum Depth of Binary Tree Python divide_and_conquer, BFS
114 Flatten Binary Tree to Linked List Python
118 Pascals Triangle Python
119 Pascals Triangle II Python
120 Triangle Rust
121 Best Time to Buy and Sell Stock Python
122 Best Time to Buy and Sell Stock II Python
123 Best Time to Buy and Sell Stock III Python
124 Binary Tree Maximum Path Sum Python
125 Valid Palindrome Python two_pointers
126 Word Ladder II Python BFS+DFS
127 Word Ladder Python 双向BFS
128 Longest Consecutive Sequence Python 并查集
129 Sum Root to Leaf Numbers Rust
130 Surrounded Regions Rust
133 Clone Graph Python DFS, BFS
134 Gas Station Rust
135 Candy Rust
136 Single Number Rust
137 Single Number II Rust
138 Copy List with Random Pointer Python
139 Word Break Python 完全背包问题
140 Word Break II Python
141 Linked List Cycle Python
142 Linked List Cycle II Python
144 Binary Tree Preorder Traversal Rust
145 Binary Tree Postorder Traversal Python DFS, stack
146 LRU Cache Python double_linked_list, OrderedDict
147 Insertion Sort List Rust
148 Sort List Rust
150 Evaluate Reverse Polish Notation Rust
151 Reverse Words in a String Rust
153 Find Minimum in Rotated Sorted Array Python binary_search
154 Find Minimum in Rotated Sorted Array II Python binary_search
155 Min Stack Python
160 Intersection of Two Linked Lists Python
164 Maximum Gap Rust
167 Two Sum II - Input array is sorted Python two_pointers
168 Excel Sheet Column Title Rust
169 Majority Element Rust
170🔒 Two Sum III - Data structure design Python two_pointers
171 Excel Sheet Column Number Rust
172 Factorial Trailing Zeroes Rust
173 Binary Search Tree Iterator Python
174 Dungeon Game Rust
175 Combine Two Tables
176 Second Highest Salary SQL
181 Employees Earning More Than Their Managers SQL
182 Duplicate Emails SQL
183 Customers Who Never Order sql
188 Best Time to Buy and Sell Stock IV Python
189 Rotate Array Rust
190 Reverse Bits Rust
191 Number of 1 Bits Rust
198 House Robber Python
200 Number of Islands Python special_data_structure.union_find, DFS, BFS
202 Happy Number Python
203 Remove Linked List Elements Python
204 Count Primes Rust
206 Reverse Linked List Python, Rust
208 Implement Trie (Prefix Tree) Rust
207 Course Schedule Python BFS, topological_sorting
209 Minimum Size Subarray Sum Python sliding_window
210 Course Schedule II Python BFS, topological_sorting
212 Word Search II Python 前缀树
213 House Robber II Python
215 Kth Largest Element in an Array Python quick_select, quick_sort, heap
216 Combination Sum III Rust
217 Contains Duplicate Rust
219 Contains Duplicate II Rust
222 Count Complete Tree Nodes Rust
224 Basic Calculator Rust
225 Implement Stack using Queues Python
226 Invert Binary Tree Rust
227 Basic Calculator II Rust
228 Summary Ranges Rust
230 Kth Smallest Element in a BST Python DFS, stack
231 Power of Two Rust
232 Implement Queue using Stacks Python
234 Palindrome Linked List Rust
235 Lowest Common Ancestor of a Binary Search Tree Python
236 Lowest Common Ancestor of a Binary Tree Python divide_and_conquer
238 Product of Array Except Self Rust
239 Sliding Window Maximum Rust
240 Search a 2D Matrix II Python
242 Valid Anagram Rust
257 Binary Tree Paths Python DFS, backtracking
260 Single Number III Rust
263 Ugly Number Rust
264 Ugly Number II Python
266🔒 Palindrome Permutation Python greedy
269🔒 Alien Dictionary Python heapq, topological_sorting
270🔒 Closest Binary Search Tree Value Python
272🔒 Closest Binary Search Tree Value II Python
278 First Bad Version Rust
279 Perfect Squares Python 完全背包问题
283 Move Zeros Rust
287 Find the Duplicate Number Python 快慢双指针
290 Word Pattern Rust
291🔒 Word Pattern II Python DFS
292 Nim Game Rust
297 Serialize and Deserialize Binary Tree Python serialize
300 Longest Increasing Subsequence Python 接龙型动态规划
302🔒 Smallest Rectangle Enclosing Black Pixels Python
303 Range Sum Query - Immutable Rust
304 Range Sum Query 2D - Immutable Rust
307 Range Sum Query - Mutable Python
309 Best Time to Buy and Sell Stock with Cooldown Python
311🔒 Sparse Matrix Multiplication Rust
312 Burst Balloons Rust
322 Coin Change Python 完全背包问题
326 Power of Three Rust
328 Odd Even Linked List Python
337 House Robber III Python
338 Counting Bits Rust
341 Flatten Nested List Iterator Rust
342 Power of Four Rust
343 Integer Break Python 划分类DP
344 Reverse String Rust
347 Top K Frequent Elements Rust
349 Intersection of Two Arrays Python
350 Intersection of Two Arrays II Python
354 Russian Doll Envelopes Python
355 Design Twitter Rust
359🔒 Logger Rate Limiter Rust
367 Valid Perfect Square Rust
368 Largest Divisible Subset Python
369🔒 Plus One Linked List Rust
371❌ Sum of Two Integers Python binary_addition
374 Guess Number Higher Or Lower Rust
377 Combination Sum IV Python 完全背包问题
380 Insert Delete GetRandom O(1) Python
381 Insert Delete GetRandom O(1) - Duplicates allowed Python
386 Lexicographical Numbers Rust
387 First Unique Character in a String Rust
389 Find The Difference Rust
398 Random Pick Index Rust
404 Sum of Left Leaves Rust
406 Queue Reconstruction by Height Rust
409 Longest Palindrome Python dp(greedy)
412 Fizz Buzz Rust
413 Arithmetic Slices Rust
415 Add String C++
416 Partition Equal Subset Sum Python 0-1背包问题
426 Longest Repeating Character Replacement Python
429 N-ary Tree Level Order Traversal C++
448 Find All Numbers Disappeared in an Array Rust
449 Serialize and Deserialize BST Python DFS, stack
454 4Sum II Rust
455 Assign Cookies Rust
457 Circular Array Loop Rust
461 Hamming Distance Rust
463 Island Perimeter Rust
470 impl rand10 using rand7 Rust
474 Ones and Zeroes Python 完全背包问题
477 Total Hamming Distance Rust
485 Max Consecutive Ones Rust
486 Validate IP Address Rust
490🔒 The Maze Rust
494 Target Sum Python 0-1背包问题
498 Diagonal Traverse Python
503 Next Greater Element II Rust
507 Perfect Number Rust
509 Fibonacci Number Rust
514 Freedom Trail Rust
518 Coin Change 2 Python 完全背包问题
523 Continuous Subarray Sum Rust
525 Contiguous Array Rust
535 Encode and Decode TinyURL very_easy
536🔒 Construct Binary Tree from String Python
538 Convert BST to Greater Tree Python
547 Friend Circles Rust
554 Brick Wall Rust
557 Reverse Words in a String III Rust
559 Maximum Depth of N-ary Tree C++
566 Reshape the Matrix Rust
575 Distribute Candies Rust
589 N-ary Tree Preorder Traversal Python
590 N-ary Tree Postorder Traversal Python
595 Big Countries sql
606 Construct String from Binary Tree Python
617 Merge Two Binary Trees Rust
605 Can Place Flowers Rust
610🔒 Triangle Judgement SQL
611 Valid Triangle Number Rust
613🔒 Shortest Distance in a Line SQL
620 Not Boring Movies SQL
625🔒 Minimum Factorization Python greedy
627 Swap Salary SQL
628 Maximum Product of Three Numbers Rust
633 Average of Levels in Binary Tree Python
643 Maximum Average Subarray I Rust
650 2 Keys Keyboard Rust
653 First Unique Number in Data Stream Python
657 Robot Return to Origin Rust
658 Find K Closest Elements Rust, Python binary_search
669 Trim A Binary Search Tree Python
674 Longest Continuous Increasing Subsequence Python
680 Valid Palindrome II Python two_pointers, greedy
682 Baseball Game Rust
690 Employee Importance java
692 Top K Frequent Words Rust
695 Max Area of Island Rust
696 Count Binary Substrings Rust
700 Search in a Binary Search Tree Rust
702🔒 Search in a Sorted Array of Unknown Size Python binary_search_first, 倍增法
703 Kth Largest Element in a Stream Rust
704 Binary Search Rust
705 Design HashSet Python
706 Design HashMap Python
709 To Lower Case Rust
713 1-bit and 2-bit Characters Rust
714 Best Time to Buy and Sell Stock with Transaction Fee Python
716🔒 Max Stack Python
724 Find Pivot Index Rust
728 Self Dividing Numbers Rust
760🔒 Find Anagram Mappings Rust
796 Rotate String Python Rabin-Karp(rolling_hash), kmp
743 Network Delay Time Python
746 Min Cost Climbing Stairs Rust
763 Partition Labels Rust
766 Toeplitz Matrix Rust
771 Jewels and Stones Rust
788 Rotated Digits Rust
797 All Paths From Source to Target Rust
807 Max Increase to Keep City Skyline Rust
830 Positions of Large Groups Rust
832 Flipping an Image Rust
841 Keys and Rooms Rust
844 Backspace String Compare Rust
845 Longest Mountain in Array Python mountain_array
852 Peak Index in a Mountain Array Rust
860 Lemonade Change Rust
861 Score After Flipping Matrix Python greedy
867 Transpose Matrix Rust, Go
869 Reordered Power of 2 Python permutation
872 Leaf Similar Trees Rust
875 Koko Eating Bananas Python
876 Middle of the Linked List Rust
877 Stone Game Rust
887 Super Egg Drop Rust
888 Fair Candy Swap Rust
889 Construct Binary Tree from Preorder and Postorder... Python DFS
905 Sort Array By Parity Rust
912 Sort An Array Python
922 Sort Array By Parity II Rust
925 Long Pressed Name Rust
938 Range Sum of BST Rust
941 Valid Mountain Array Python mountain_array
942 DI String Match Rust
950 Reveal Cards In Increasing Order Rust
953 Verifying an Alien Dictionary Python
961 N-Repeated Element in Size 2N Array Rust
973 K Closest Points to Origin Rust quick_select
976 Largest Perimeter Triangle Rust
977 Squares of a Sorted Array Rust
989 Add to Array-Form of Integer Rust
993 Cousins In Binary Tree Rust
1002 Find Common Characters Rust
1006 Clumsy Factorial Rust
1018 Binary Prefix Divisible By 5 Rust
1030 Matrix Cells in Distance Order Rust
1038 Binary Search Tree to Greater Sum Tree Python
1046 Last Stone Weight Python
1049 Last Stone Weight II Python 0-1背包问题
1051 Height Checker Rust
1068🔒 Product Sales Analysis I SQL
1069🔒 Product Sales Analysis II SQL
1095 Find in Mountain Array Python binary_search, mountain_array
1099🔒 Two Sum Less Than K Python two_pointers
1108 Defanging an IP Address Rust
1128 Number of Equivalent Domino Pairs Rust
1109 Corporate Flight Bookings Rust
1119🔒 Remove Vowels from a String Rust
1134🔒 Armstrong Number Rust
1143 Longest Common Subsequence Python
1160 Find Words That Can Be Formed by Ch... Rust
1167🔒 Minimum Cost To Connect Sticks Rust
1180🔒 Count Substrings with Only One Distinct Letter Rust
1207 Unique Number of Occurrences Rust
1213🔒 Intersection of Three Sorted Arrays Rust
1226 The Dining Philosophers C++
1227 Airplane Seat Assignment Probability Rust
1232 Check If It Is a Straight Line Rust
1248 Count Number of Nice Subarrays Rust
1251🔒 Average Selling Price SQL
1252 Cells with Odd Values in a Matrix Rust
1265🔒 Print Immutable Linked List in Reverse C
1266 Minimum Time Visiting All Points Rust
1269 Number of Ways to Stay in the Same... Rust
1281 Subtract the Product and Sum of Digits... Rust
1295 Find Numbers with Even Number of Digits Rust
1299 Replace Elements with Greatest Element on Right... Rust
1303🔒 Find the Team Size SQL
1313 Decompress Run-Length Encoded List Python
1329 Sort The Matrix Diagonally Rust
1342 Number of Steps to Reduce a Number to Zero Rust
1346 Check If N and Its Double Exist Rust
1351 Count Negative Numbers in a Sorted Matrix Rust
1356 Sort Integers by The Number of 1 Bits Rust
1365 How Many Numbers Are Smaller Than the Current Number Rust
1370 Increasing Decreasing String Rust
1374 Generate a String With Characters That Have Odd Counts Rust
1379 Find a Corresponding Node of a Binary Tree ... Python
1380 Lucky Numbers in a Matrix Rust
1389 Create Target Array in the Given Order Rust
1395 Count Number of Teams Rust
1409 Queries on a Permutation With Key Rust
1429🔒 First Unique Number Python
1431 Kids With the Greatest Number of Candies Rust
1436 Destination City Rust
1445🔒 Apples Oranges SQL
1450 Number of Students Doing Homework at ... Rust
1464 Maximum Product of Two Elements in an Array Rust
1470 Shuffle the Array Rust
1475 Final Prices With a Special Discount... Rust
1476 Subrectangle Queries Rust
1480 Running Sum of 1d Array Rust
1486 XOR Operation in an Array Rust, Racket
1502 Can Make Arithmetic Progression From Sequence Rust
1512 Number of Good Pairs Rust
1528 Shuffle String Rust
1534 Count Good Triplets Rust
1551 Minimum Operations to Make Array Equal Rust
1570 Dot Product of Two Sparse Vectors Rust
1572 Matrix Diagonal Sum Rust
1576 Replace All ?'s to Avoid Consecutive ... Rust
1577 Number of Ways Where Square of ... Rust
1578 Minimum Deletion Cost to Avoid Repeating ... Rust
1582 Special Positions in a Binary Matrix Rust
1584 Min Cost to Connect All Points Rust
1588 Sum of All Odd Length Subarrays Rust
1601 Design Parking System Rust
1614 Maximum Nesting Depth of the Parentheses Rust
1636 Sort Array by Increasing Frequency Rust
1637 Widest Vertical Area Between Two Points ... Rust
1640 Check Array Formation Through Concatenation Rust
1656 Design an Ordered Stream Rust
1658 Defuse The Bomb Rust
1662 Check If Two String Arrays are Equivalent Rust
1672 Richest Customer Wealth Rust
1678 Goal Parser Interpretation Rust
1683🔒 Invalid Tweets SQL
1684 Count the Number of Consistent Strings Rust
1688 Count of Matches in Tournament Rust
1694 Reformat Phone Number Rust
1700 Number of Students Unable to Eat Lunch Rust
1710 Maximum Units on a Truck Rust
1711 Count Good Meals Rust
1716 Calculate Money in Leetcode Bank Rust
1720 Decode XORed Array Rust
1725 Number Of Rectangles That Can ... Rust
1732 Find the Highest Altitude Rust
1741🔒 Find Total Time Spent by Each Employee SQL
1744 Can You Eat Your Favorite Candy... Rust
1748 Sum of Unique Elements Rust
1752 Check if Array Is Sorted and Rotated Rust
1753 Maximum Score From Removing Stones Rust
1754 Largest Merge Of Two Strings Rust
1790 Check if One String Swap Can Make Strings Equal Rust
1816 Truncate Sentence Rust
1834 Single Threaded Cpu Rust
1837 Sum of Digits in Base K Rust
1839 Longest Substring Of All Vowels in Order Rust
1844 Replace All Digits with Characters Rust
1845 Seat Reservation Manager Rust
1848 Minimum Distance to the...t Rust
1854 Maximum Population Year Rust
1863 Sum of All Subset XOR Totals Rust
1880 Check if Word Equals... Rust
1913 Maximum Product Diff... Rust

剑指Offer(lcof)

# Title Solutions Category
59 队列的最大值 Python
60 n个骰子的点数 Python
61 扑克牌中的顺子 Python
62 圆圈中最后剩下的数字 Python 约瑟夫环

lintcode_problems

# Title Solutions Category
1 A + B Problem leetcode_372
2 Trailing Zeros leetcode_172
3 Digit Counts Python
4 Ugly Number II leetcode_264
5 Kth Largest Element Python quick_select, heap
6 Merge Two Sorted Arrays leetcode_88
7 Serialize and Deserialize Binary Tree leetcode_297
8 Rotate String leetcode_796
11 Search Range in Binary Search Tree leetcode_938
12 Min Stack leetcode_155
20 Dices Sum Python
22 Flatten List leetcode_314
28 Search a 2D Matrix leetcode_74
31 Partition Array Python two_pointers
38 Search a 2D Matrix II leetcode_240
40 Implement Queue by Two Stacks Python
41 Maximum Subarray Python greedy, dp
49 Sort Letters by Case Python
50 Product of Array Exclude Itself leetcode_lcof_66
52 Next Permutation Python
53 Reverse Words in a String leetcode_151
57 3Sum leetcode_15
58 4Sum leetcode_18
59 3Sum Closest leetcode_16
60 Search Insert Position leetcode_35
61 Search for a Range leetcode_34
62 Search in Rotated Sorted Array leetcode_33
63 Search in Rotated Sorted Array II leetcode_81
64 Merge Sorted Array leetcode_88
66 Binary Tree Preorder Traversal leetcode_144
67 Binary Tree Inorder Traversal leetcode_94
68 Binary Tree Postorder Traversal leetcode_145
69 Binary Tree Level Order Traversal leetcode_102
70 Binary Tree Level Order Traversal II leetcode_102
72 Construct Binary Tree from Inorder and Postorder Traversal leetcode_106
73 Construct Binary Tree from Preorder and Inorder Traversal leetcode_105
75 Find Peak Element leetcode_825
76 Longest Increasing Subsequence Python 接龙型动态规划
77 Longest Common Subsequence Python
78 Longest Common Prefix leetcode_14
79 Longest Common Substring Python
80 Median Python quick_select
83 Single Number II leetcode_137
84 Single Number III leetcode_260
86 Binary Search Tree Iterator Python
88 Lowest Common Ancestor of a Binary Tree Python divide_and_conquer
90 k Sum II Python
92 Backpack Python
93 Balanced Binary Tree Python divide_and_conquer
94 Binary Tree Maximum Path Sum leetcode_124
95 Validate Binary Search Tree Python
96 Partition List leetcode_86
97 Maximum Depth of Binary Tree leetcode_104
98 Sort List leetcode_148
100 Remove Duplicates from Sorted Array leetcode_26
103 Linked List Cycle II leetcode_142
104 Merge k Sorted Lists leetcode_23
105 Copy List with Random Pointer Python
106 Convert Sorted List to Binary Search Tree Python divide_and_conquer
107 Word Break Python 完全背包问题
109 Triangle leetcode_120
110 Minimum Path Sum Python
113 Remove Duplicates from Sorted List II leetcode_82
123 Word Search Python
124 Longest Consecutive Sequence Python 并查集
125 Backpack II Python
127 Topological Sorting Python BFS, topological_sorting
128 Hash Function Python
129 Rehashing Python
135 Combination Sum Python, Rust
137 Clone Graph Python DFS, BFS
138 Subarray Sum Python
143 Sort Colors II Python quick_sort, counting_sort
144 interleaving_positive_and_negative_numbers Python
145 Lower case to Uppercase leetcode_709
147🔒 Narcissistic Number Python
148 Sort Colors Python three_pointers, partition_array
151 Best Time to Buy and Sell Stock III leetcode_123
153 Combination Sum II Python, Rust
154 Regular Expression Matching leetcode_10
159 Find Minimum in Rotated Sorted Array leetcode_153
160 Find Minimum in Rotated Sorted Array II Python binary_search
161 Rotate Image Rust
168 Burst Balloons Python
171 Anagrams Python
173 Insertion Sort List leetcode_147
174 Remove Nth Node From End of List leetcode_19
177 Convert Sorted Array to Binary Search Tree With Minimal Height Python divide_and_conquer
181 Flip Bits leetcode_461
183 Wood Cut Python greedy
190 Next Permutation II Python
192 Wildcard Matching Python
197 Permutation Index Python
235 Prime Factorization Python 分解质因数
249 Count of Smaller Number before itself Python sqrt_n
254 Drop Eggs Python sqrt_n
272🔒 Climbing Stairs II Python
298 Find Primes leetcode_204
309 Interleaved Array
328 String Partition leetcode_763
334 Order Check leetcode_1051
372 Delete Node in a Linked List leetcode_237
373 Partition Array by Odd and Even leetcode_905
374 Spiral Matrix leetcode_54
376 Binary Tree Path Sum Python DFS, backtracking
380 Intersection of Two Linked Lists Python
381 Spiral Matrix II leetcode_59
384 Longest Substring Without Repeating Characters leetcode_3
386 Longest Substring with At Most K Distinct Characters Python
388 Permutation Sequence Python
392 House Robber Python
393 Best Time to Buy and Sell Stock IV Python
397 Longest Continuous Increasing Subsequence Python
400 Maximum Gap leetcode_164
406 Minimum Size Subarray Sum Python sliding_window
407 Plus One leetcode_66
408 Add Binary leetcode_67
412 Candy leetcode_135
415 Valid Palindrome Python two_pointers
417 Valid number leetcode_65
423 Valid Parentheses leetcode_20
425 Letter Combinations of a Phone Number leetcode_17
426 Restore IP Addresses leetcode_93
427 Generate Parentheses leetcode_22
428 Pow(x, n) leetcode_50
437 Copy Books Python dp, binary_search
440🔒 Backpack III Python
443🔒 Two Sum - Greater than target Python two_pointers
447🔒 Search in a Big Sorted Array Python binary_search_first, 倍增法
451 Swap Nodes in Pairs leetcode_24
453 Flatten Binary Tree to Linked List Python
460 Find K Closest Elements leetcode_658
461 Kth Smallest Numbers in Unsorted Array Python
462 Total Occurrence of Target leetcode_34
464 Sort Integers II Python
466 Count Linked List Nodes too_easy
474🔒 Lowest Common Ancestor II Python
476 Stone Game(diff to leetcode) Python
480 Binary Tree Paths Python DFS, backtracking
486 Merge K Sorted Arrays Python
488 Happy Number leetcode_202
491 Palindromic Number leetcode_9
492 Implement Queue by Linked List Python
494 Implement Stack by Two Queues Python
495 Implement Stack Python
512 Decode Ways Python
513 Perfect Squares Python 完全背包问题
521🔒 Remove Duplicate Numbers in Array Python partition_array
533🔒 Two Sum - Closest to target Python two_sum
535 House Robber III leetcode_337
544 Top k Largest Numbers Python min_heap
545 Top k Largest Numbers II Python min_heap
547 Intersection of Two Arrays Python
548 Intersection of Two Arrays II Python
562 Backpack IV Python 完全背包问题
564 Combination Sum IV Python 完全背包问题
563 Backpack V Python
577 Merge k Sorted Interval Lists Python
578 Lowest Common Ancestor III Python
584 Drop Eggs II Rust dp
587🔒 Two Sum - Unique pairs Python two_sum
588 Partition Equal Subset Sum Python 0-1背包问题
594 Implement strStr() II Python kmp, Rabin-Karp(rolling_hash)
596🔒 Minimum Subtree Python divide_and_conquer
600 Smallest Rectangle Enclosing Black Pixels Python
603 Largest Divisible Subset Python
606 Kth Largest Element II Python quick_select, quick_sort, heap
607 Two Sum III - Data structure design Python two_pointers
608 Two Sum II - Input array is sorted Python two_pointers
609 Two Sum - Less than or equal to target Python two_pointers
610 Two Sum - Difference equals to target Python two_pointers
611🔒 Knight Shortest Path Python bfs
612🔒 K Closest Points leetcode_973
615 Course Schedule Python BFS, topological_sorting
616 Course Schedule II Python BFS, topological_sorting
627 Longest Palindromic Combination Python greedy
628 Maximum Subtree Python divide_and_conquer
630🔒 Knight Shortest Path II Python bfs
633 Find the Duplicate Number Python 快慢双指针
654 Sparse Matrix Multiplication leetcode_311
655 Add String leetcode_67
657 Insert Delete GetRandom O(1) Python
661 Convert BST to Greater Tree Python
667 Longest Palindromic Subsequence Python dp(greedy)
668 Ones and Zeroes leetcode_474
669 Coin Change Python 完全背包问题
683 Word Break III Python
685 First Unique Number in Data Stream Python
689 First Unique Number in Data Stream Python
691 Recover Binary Search Tree Python
701 Trim A Binary Search Tree Python
702 Russian Doll Envelopes Python
719 Calculate Maximum Value Python
724 Minimum Partition Python 0-1背包问题
740 Coin Change 2 Python 完全背包问题
741 Calculate Maximum Value II Python
749 John's backyard garden Python
769 Spiral Array leetcode_59
787 The Maze leetcode_490
793 Intersection of Arrays Python
802 Soduku Solver Python
813 Find Anagram Mappings leetcode_760
816 Traveling Salesman Problem Python
829 Word Pattern II leetcode_291
839 Merge Two Sorted Interval Lists Python
840 Range Sum Query - Mutable leetcode_307
841 String Replace Python
845 Greatest Common Divisor Python
859 Max Stack Python
871 Minimum Factorization Python greedy
880 Construct Binary Tree from String Python
891 Valid Palindrome II Python two_pointers, greedy
892 Alien Dictionary Python heapq, topological_sorting
900 Closest Binary Search Tree Value Python
901 Closest Binary Search Tree Value II Python
902 Kth Smallest Element in a BST Python DFS, stack
904 Plus One Linked List leetcode_369
916 Palindrome Permutation leetcode_266
954 Insert Delete GetRandom O(1) - Duplicates allowed Python
973 1-bit and 2-bit Characters leetcode_713
975 2 Keys Keyboard leetcode_650
976 4Sum II leetcode_454
982 Arithmetic Slices leetcode_413
995 Best Time ... Stock with Cooldown Python
1000 Best Time ... Stock with ... Fee leetcode_714
1028 Rotated Digits leetcode_788
1038 Jewels and Stones leetcode_771
1054 Min Cost Climbing Stairs leetcode_746
1057 Network Delay Time leetcode_743
1079 Count Binary Substrings leetcode_696
1115 Average of Levels in Binary Tree leetcode_633
1137 Construct String from Binary Tree leetcode_606
1147 Work Plan Python
1186 Encode and Decode TinyURL leetcode_535
1196 Freedom Trail leetcode_514
1201 Next Greater Element II leetcode_503
1205 Diagonal Traverse leetcode_498
1208 Target Sum Python 0-1背包问题
1212 Max Consecutive Ones leetcode_485
1235 Serialize and Deserialize BST leetcode_449
1246 Longest Repeating Character Replacement leetcode_426
1252 Queue Reconstruction by Height leetcode_406
1266 Find The Difference leetcode_389
386 Lexicographical Numbers leetcode_386
1276 Sum of Two Integers Python binary_addition
1284 Integer Break Python 划分类DP
1292 Odd Even Linked List leetcode_328
1311 Lowest Common Ancestor of a Binary Search Tree Python
1317 Count Complete Tree Nodes leetcode_222
1319 Contains Duplicate II leetcode_219
1321🔒 Combination Sum III leetcode_216
1343 Sum of Two Strings Python
1359 Convert Sorted Array to Binary Search Tree Python divide_and_conquer
1375 Substring With At Least K Distinct Characters Python
1424 Longest Mountain in Array leetcode_845
1438 Positions of Large Groups leetcode_830
1479 Can Reach The Endpoint Python bfs
1499 Reordered Power of 2 Python permutation
1508 Score After Flipping Matrix Python greedy
1509 Lemonade Change Rust
1524 Search in a Binary Search Tree leetcode_700
1593 Construct Binary Tree from Preorder and Postorder ... Python DFS
1790🔒 Rotate String II Python reverse, circle_shift
1870 number of substrings with all zeroes Python

todo_dp:

  • 划分型动态规划:戳气球、石子归并(dp/stone_game_merge.py)
  • 选或不选类DP: 打家劫舍系列/股票买卖系列
  • 计数型动态规划: k sum
  • 43/415 字符串整数相乘/相加
  • 415是经典面试题利用字符串模拟竖式加法进行大数相加
  • 有兴趣但是困难级别的题: 1. 推箱子 2. 华容道
  • [ ]最大直方图矩阵(Longest Histogram Rectangle), 单调栈O(n^3)->O(n)

some awesome leetcode rust solutions repos

other awesome leetcode repos I recommend

About

leetcode/codeforces Rust solution with unittest, leetcode-rust and codeforces-rust

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 100.0%