Skip to content

StrayLittlePunk/leetcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LeetCode

(Notes: "đź”’" means you need to buy subscription from Leetcode)

Directory

Array

No Title Solution Difficulty
4 Median of Two Sorted Arrays Rust Hard
11 Container With Most Water Rust Medium
21 Merge Two Sorted Lists Rust Easy
27 Remove Element Rust Easy
33 Search in Rotated Sorted Array Rust Hard
34 Search for a Range Rust Medium
35 Search Insert Position Rust Medium
42 Trapping Rain Water Rust Hard
45 Jump Game II Rust Hard
53 Maximum Subarray Rust Medium
75 Sort Colors Rust Medium
81 Search in Rotated Sorted Array II Rust Medium
88 Merge Sorted Array Rust Easy
121 Best Time to Buy and Sell Stock Rust Medium
122 Best Time to Buy and Sell Stock II Rust Medium
123 Best Time to Buy and Sell Stock III Rust Hard
135 Candy Rust Hard
152 Maximum Product Subarray Rust Medium
153 Find Minimum in Rotated Sorted Array Rust Medium
154 Find Minimum in Rotated Sorted Array II Rust Hard
162 Find Peak Element Rust Medium
163 Missing Ranges Rust Medium
164 Maximum Gap Rust Hard
188 Best Time to Buy and Sell Stock IV Rust Hard
209 Minimum Size Subarray Sum Rust Medium
228 Summary Ranges Rust Easy
229 Majority Element II Rust Medium
238 Product of Array Except Self Rust Medium
239 Sliding Window Maximum Rust Hard
243 Shortest Word Distance Rust Easy
252 Meeting Rooms Rust Easy
253 Meeting Rooms II Rust Medium
280 Wiggle Sort Rust Medium
283 Move Zeroes Rust Easy
287 Find the Duplicate Number Rust Hard
289 Game of Life Rust Medium
295 Find Median from Data Stream Rust Hard
300 Longest Increasing Subsequence Rust Medium
309 Best Time to Buy and Sell Stock with Cooldown Rust Medium
321 Create Maximum Number Rust Hard
324 Wiggle Sort II Rust Medium
325 Maximum Size Subarray Sum Equals k Rust Medium
330 Patching Array Rust Medium
334 Increasing Triplet Subsequence Rust Medium
349 Intersection of Two Arrays Rust Easy
350 Intersection of Two Arrays II Rust Easy
352 Data Stream as Disjoint Intervals Rust Hard
354 Russian Doll Envelopes Rust Hard
376 Wiggle Subsequence Rust Medium
560 Subarray Sum Equals K Rust Medium
575 Distribute Candies Rust Easy
581 Shortest Unsorted Continuous Subarray Rust Easy
665 Non-decreasing Array Rust Medium
674 Longest Continuous Increasing Subsequence Rust Easy
704 Binary Search Rust Easy
724 Find Pivot Index Rust Easy
821 Shortest Distance to a Character Rust Easy
896 Monotonic Array Rust Easy
904 Fruit Into Baskets Rust Medium
905 Sort Array By Parity Rust Easy
931 Minimum Falling Path Sum Rust Medium
939 Minimum Area Rectangle Rust Medium
941 Valid Mountain Array Rust Easy
969 Pancake Sorting Rust Medium
977 Squares of a Sorted Array Rust Easy
986 Interval List Intersections Rust Medium
989 Add to Array-Form of Integer Rust Easy
1053 Previous Permutation With One Swap Rust Medium
1266 Minimum Time Visiting All Points Rust Easy
1281 Subtract the Product and Sum of Digits of an Integer Rust Easy
1287 Element Appearing More Than 25% In Sorted Array Rust Easy
1299 Replace Elements with Greatest Element on Right Side Rust Easy
1314 Matrix Block Sum Rust Medium
1375 Bulb Switcher III Rust Medium

Backtracking

No Title Solution Difficulty
17 Letter Combinations of a Phone Number Rust Medium
31 Next Permutation Rust Medium
39 Combination Sum Rust Medium
40 Combination Sum II Rust Medium
46 Permutations Rust Medium
47 Permutations II Rust Hard
60 Permutation Sequence Rust Medium
77 Combinations Rust Medium
78 Subsets Rust Medium
90 Subsets II Rust Medium
93 Restore IP Addresses Rust Medium
140 Word Break II Rust Hard
216 Combination Sum III Rust Medium
254 Factor Combinations Rust Medium
282 Expression Add Operators Rust Hard
291 Word Pattern II Rust Hard
320 Generalized Abbreviation Rust Medium
351 Android Unlock Patterns Rust Medium
377 Combination Sum IV Rust Medium
784 Letter Case Permutation Rust Medium
1219 Path with Maximum Gold Rust Medium

Bit Manipulation

No Title Solution Difficulty
89 Gray Code Rust Medium
136 Single Number Rust Medium
137 Single Number II Rust Medium
191 Number of 1 Bits Rust Easy
201 Bitwise AND of Numbers Range Rust Medium
260 Single Number III Rust Medium
268 Missing Number Rust Medium
318 Maximum Product of Word Lengths Rust Medium
338 Counting Bits Rust Medium
371 Sum of Two Integers Rust Easy
389 Find the Difference Rust Easy
393 UTF-8 Validation Rust Medium

C

No Title Solution Difficulty
116 Populating Next Right Pointers in Each Node C Medium
117 Populating Next Right Pointers in Each Node II C Hard
133 Clone Graph C Medium
138 Copy List with Random Pointer C Hard
141 Linked List Cycle C Medium
142 Linked List Cycle II C Medium
157 Read N Characters Given Read4 C Easy
158 Read N Characters Given Read4 II - Call multiple times C Hard
160 Intersection of Two Linked Lists C Easy
190 Reverse Bits C Easy
235 Lowest Common Ancestor of a Binary Search Tree C Easy
236 Lowest Common Ancestor of a Binary Tree C Medium
237 Delete Node in a Linked List C Easy
284 Peeking Iterator C Medium
285 Inorder Successor in BST C Medium
297 Serialize and Deserialize Binary Tree C Medium

Design

No Title Solution Difficulty
146 LRU Cache Rust Hard
170 Two Sum III - Data structure design Rust Easy
170 Flatten 2D Vector Rust Medium
281 Zigzag Iterator Rust Medium
288 Unique Word Abbreviation Rust Medium
303 Range Sum Query - Immutable Rust Easy
304 Range Sum Query 2D - Immutable Rust Medium
307 Range Sum Query - Mutable Rust Medium
308 Range Sum Query 2D - Mutable Rust Hard
346 Moving Average from Data Stream Rust Easy
348 Design Tic-Tac-Toe Rust Medium
353 Design Snake Game Rust Medium
355 Design Twitter Rust Medium
359 Logger Rate Limiter Rust Easy
362 Design Hit Counter Rust Medium
379 Design Phone Directory Rust Medium
731 My Calendar II Rust Medium
1032 Stream of Characters Rust Hard
1206 Design Skiplist Rust Hard
1352 Product of the Last K Numbers Rust Medium
1429 First Unique Number Rust Medium
1570 Dot Product of Two Sparse Vectors Rust Medium

Dynamic Programming

No Title Solution Difficulty
10 Regular Expression Matching Rust Hard
44 Wildcard Matching Rust Hard
62 Unique Paths Rust Medium
63 Unique Paths II Rust Medium
70 Climbing Stairs Rust Easy
72 Edit Distance Rust Hard
85 Maximal Rectangle Rust Hard
91 Decode Ways Rust Medium
97 Interleaving String Rust Hard
120 Triangle Rust Medium
128 Longest Consecutive Sequence Rust Hard
139 Word Break Rust Medium
174 Dungeon Game Rust Hard
198 House Robber Rust Easy
213 House Robber II Rust Medium
221 Maximal Square Rust Medium
256 Paint House Rust Medium
265 Paint House II Rust Hard
276 Paint Fence Rust Easy
279 Perfect Squares Rust Medium
312 Burst Balloons Rust Hard
322 Coin Change Rust Medium
363 Max Sum of Rectangle No Larger Than K Rust Hard
375 Guess Number Higher or Lower II Rust Medium
413 Arithmetic Slices Rust Medium
1000 Minimum Cost to Merge Stones Rust Hard
1066 Campus Bikes II Rust Medium
1155 Number of Dice Rolls With Target Sum Rust Medium
1196 How Many Apples Can You Put into the Basket Rust Easy
1335 Minimum Difficulty of a Job Schedule Rust Hard
1504 Count Submatrices With All Ones Rust Medium

Graph

No Title Solution Difficulty
51 N-Queens Rust Hard
52 N-Queens II Rust Hard
126 Word Ladder II Rust Hard
127 Word Ladder Rust Medium
130 Surrounded Regions Rust Medium
149 Max Points on a Line Rust Hard
200 Number of Islands Rust Medium
207 Course Schedule Rust Medium
210 Course Schedule II Rust Medium
223 Rectangle Area Rust Easy
261 Graph Valid Tree Rust Medium
269 Alien Dictionary Rust Hard
286 Walls and Gates Rust Medium
305 Number of Islands II Rust Hard
310 Minimum Height Trees Rust Medium
323 Number of Connected Components in an Undirected Graph Rust Medium
335 Self Crossing Rust Hard
339 Nested List Weight Sum Rust Easy
356 Line Reflection Rust Medium
364 Nested List Weight Sum II Rust Medium
391 Perfect Rectangle Rust Hard
399 Evaluate Division Rust Medium
444 Sequence Reconstruction Rust Medium
463 Island Perimeter Rust Easy
675 Cut Off Trees for Golf Event Rust Hard
695 Max Area of Island Rust Medium
766 Toeplitz Matrix Rust Easy
787 Cheapest Flights Within K Stops Rust Medium
841 Keys and Rooms Rust Medium
1254 Number of Closed Islands Rust Medium

Linkedlist

No Title Solution Difficulty
2 Add Two Numbers Rust Medium
19 Remove Nth Node From End of List Rust Easy
21 Merge Two Sorted Lists Rust Easy
23 Merge k Sorted Lists Rust Hard
24 Swap Nodes in Pairs Rust Medium
25 Reverse Nodes in k-Group Rust Hard
61 Rotate List Rust Medium
82 Remove Duplicates from Sorted List II Rust Medium
83 Remove Duplicates from Sorted List Rust Easy
86 Partition List Rust Medium
92 Reverse Linked List II Rust Medium
143 Reorder List Rust Medium
147 Insertion Sort List Rust Medium
148 Sort List Rust Medium
203 Remove Linked List Elements Rust Easy
206 Reverse Linked List Rust Easy
234 Palindrome Linked List Rust Easy
328 Odd Even Linked List Rust Medium
369 Plus One Linked List Rust Medium
876 Middle of the Linked List Rust Easy

Math

No Title Solution Difficulty
1 Two Sum Rust Easy
7 Reverse Integer Rust Easy
8 String to Integer (atoi) Rust Easy
15 3Sum Rust Medium
16 3Sum Closest Rust Medium
18 4Sum Rust Medium
29 Divide Two Integers Rust Medium
36 Valid Sudoku Rust Easy
37 Sudoku Solver Rust Hard
43 Multiply Strings Rust Medium
48 Rotate Image Rust Medium
50 "Pow(x, n)" Rust Medium
54 Spiral Matrix Rust Medium
59 Spiral Matrix II Rust Medium
66 Plus One Rust Easy
67 Add Binary Rust Easy
69 Sqrt(x) Rust Medium
73 Set Matrix Zeroes Rust Medium
74 Search a 2D Matrix Rust Medium
79 Word Search Rust Medium
165 Compare Version Numbers Rust Easy
166 Fraction to Recurring Decimal Rust Medium
167 Two Sum II - Input array is sorted Rust Medium
172 Factorial Trailing Zeroes Rust Easy
202 Happy Number Rust Easy
204 Count Primes Rust Easy
231 Power of Two Rust Easy
233 Number of Digit One Rust Medium
240 Search a 2D Matrix II Rust Medium
258 Add Digits Rust Easy
259 3Sum Smaller Rust Medium
292 Nim Game Rust Easy
296 Best Meeting Point Rust Hard
302 Smallest Rectangle Enclosing Black Pixels Rust Hard
306 Additive Number Rust Medium
311 Sparse Matrix Multiplication Rust Medium
317 Shortest Distance from All Buildings Rust Hard
319 Bulb Switcher Rust Medium
326 Power of Three Rust Easy
329 Longest Increasing Path in a Matrix Rust Medium
342 Power of Four Rust Easy
343 Integer Break Rust Medium
357 Count Numbers with Unique Digits Rust Medium
360 Sort Transformed Array Rust Medium
361 Bomb Enemy Rust Medium
365 Water and Jug Problem Rust Medium
367 Valid Perfect Square Rust Easy
368 Largest Divisible Subset Rust Medium
370 Range Addition Rust Medium
372 Super Pow Rust Medium
378 Kth Smallest Element in a Sorted Matrix Rust Medium
386 Lexicographical Numbers Rust Medium
390 Elimination Game Rust Medium
396 Rotate Function Rust Easy
397 Integer Replacement Rust Medium
400 Nth Digit Rust Medium
885 Spiral Matrix III Rust Medium
1131 Maximum of Absolute Value Expression Rust Medium
1137 N-th Tribonacci Number Rust Easy
1439 Find the Kth Smallest Sum of a Matrix With Sorted Rows Rust Hard
1518 Water Bottles Rust Easy

Random

No Title Solution Difficulty
380 Insert Delete GetRandom O(1) Rust Hard
381 Insert Delete GetRandom O(1) - Duplicates allowed Rust Hard
382 Linked List Random Node Rust Medium
384 Shuffle an Array Rust Medium
398 Random Pick Index Rust Medium

SqlBash

No Title Solution Difficulty
175 Combine Two Tables SQL Easy
176 Second Highest Salary SQL Easy
177 Nth Highest Salary SQL Medium
178 Rank Scores SQL Medium
180 Consecutive Numbers SQL Medium
181 Employees Earning More Than Their Managers SQL Easy
182 Duplicate Emails SQL Easy
183 Customers Who Never Order SQL Easy
184 Department Highest Salary SQL Medium
185 Department Top Three Salaries SQL Hard
192 Word Frequency SHELL Medium
193 Valid Phone Numbers SHELL Easy
194 Transpose File SHELL Medium
195 Tenth Line SHELL Easy
196 Delete Duplicate Emails SQL Easy
197 Rising Temperature SQL Easy
262 Trips and Users SQL Hard
595 Big Countries SQL Easy
627 Swap Salary SQL Easy
620 Not Boring Movies SQL Easy
596 Classes More Than 5 Students SQL Easy
626 Exchange Seats SQL Medium

Stack Priority Queue

No Title Solution Difficulty
71 Simplify Path Rust Medium
84 Largest Rectangle in Histogram Rust Hard
150 Evaluate Reverse Polish Notation Rust Medium
155 Min Stack Rust Easy
215 Kth Largest Element in an Array Rust Medium
218 The Skyline Problem Rust Hard
224 Basic Calculator Rust Medium
225 Implement Stack using Queues Rust Medium
227 Basic Calculator II Rust Medium
232 Implement Queue using Stacks Rust Easy
263 Ugly Number Rust Easy
264 Ugly Number II Rust Medium
313 Super Ugly Number Rust Medium
332 Reconstruct Itinerary Rust Medium
341 Flatten Nested List Iterator Rust Medium
347 Top K Frequent Elements Rust Medium
373 Find K Pairs with Smallest Sums Rust Medium
385 Mini Parser Rust Medium
388 Longest Absolute File Path Rust Medium
394 Decode String Rust Medium
503 Next Greater Element II Rust Medium
857 Minimum Cost to Hire K Workers Rust Hard
1221 Split a String in Balanced Strings Rust Easy

String

No Title Solution Difficulty
3 Longest Substring Without Repeating Characters Rust Medium
5 Longest Palindromic Substring Rust Medium
6 ZigZag Conversion Rust Easy
9 Palindrome Number Rust Easy
12 Integer to Roman Rust Medium
13 Roman to Integer Rust Easy
14 Longest Common Prefix Rust Easy
20 Valid Parentheses Rust Easy
22 Generate Parentheses Rust Medium
28 Implement strStr() Rust Easy
30 Substring with Concatenation of All Words Rust Hard
32 Longest Valid Parentheses Rust Hard
38 Count and Say Rust Easy
49 Group Anagrams Rust Medium
58 Length of Last Word Rust Easy
65 Valid Number Rust Easy
68 Text Justification Rust Hard
76 Minimum Window Substring Rust Hard
87 Scramble String Rust Hard
115 Distinct Subsequences Rust Hard
125 Valid Palindrome Rust Easy
131 Palindrome Partitioning Rust Medium
132 Palindrome Partitioning II Rust Hard
151 Reverse Words in a String Rust Medium
159 Longest Substring with At Most Two Distinct Characters Rust Hard
161 One Edit Distance Rust Medium
168 Excel Sheet Column Title Rust Easy
171 Excel Sheet Column Number Rust Easy
179 Largest Number Rust Medium
186 Reverse Words in a String II Rust Medium
187 Repeated DNA Sequences Rust Medium
205 Isomorphic Strings Rust Easy
208 Implement Trie (Prefix Tree) Rust Medium
211 Add and Search Word - Data structure design Rust Medium
212 Word Search II Rust Hard
214 Shortest Palindrome Rust Hard
241 Different Ways to Add Parentheses Rust Medium
242 Valid Anagram Rust Easy
246 Strobogrammatic Number Rust Easy
247 Strobogrammatic Number II Rust Medium
248 Strobogrammatic Number III Rust Hard
249 Group Shifted Strings Rust Medium
266 Palindrome Permutation Rust Easy
267 Palindrome Permutation II Rust Medium
271 Encode and Decode Strings Rust Medium
273 Integer to English Words Rust Medium
290 Word Pattern Rust Easy
293 Flip Game Rust Easy
294 Flip Game II Rust Medium
301 Remove Invalid Parentheses Rust Hard
316 Remove Duplicate Letters Rust Hard
336 Palindrome Pairs Rust Hard
340 Longest Substring with At Most K Distinct Characters Rust Hard
344 Reverse String Rust Easy
345 Reverse Vowels of a String Rust Easy
358 Rearrange String k Distance Apart Rust Hard
383 Ransom Note Rust Easy
387 First Unique Character in a String Rust Easy
392 Is Subsequence Rust Medium
395 Longest Substring with At Least K Repeating Characters Rust Medium
459 Repeated Substring Pattern Rust Easy
557 Reverse Words in a String III Rust Easy
567 Permutation in String Rust Medium
647 Palindromic Substrings Rust Medium
680 Valid Palindrome II Rust Easy
796 Rotate String Rust Easy
804 Unique Morse Code Words Rust Easy
819 Most Common Word Rust Easy
884 Uncommon Words from Two Sentences Rust Easy
929 Unique Email Addresses Rust Easy
1002 Find Common Characters Rust Easy
1047 Remove All Adjacent Duplicates In String Rust Easy
1071 Greatest Common Divisor of Strings Rust Easy
1092 Shortest Common Supersequence Rust Hard
1100 Find K-Length Substrings With No Repeated Characters Rust Medium
1160 Find Words That Can Be Formed by Characters Rust Easy
1347 Minimum Number of Steps to Make Two Strings Anagram Rust Medium
1528 Shuffle String Rust Easy
1629 Slowest Key Rust Easy
1689 Partitioning Into Minimum Number Of Deci-Binary Numbers Rust Medium

Tree

No Title Solution Difficulty
94 Binary Tree Inorder Traversal Rust Medium
95 Unique Binary Search Trees II Rust Medium
96 Unique Binary Search Trees Rust Medium
98 Validate Binary Search Tree Rust Medium
99 Recover Binary Search Tree Rust Hard
100 Same Tree Rust Easy
101 Symmetric Tree Rust Easy
102 Binary Tree Level Order Traversal Rust Easy
103 Binary Tree Zigzag Level Order Traversal Rust Medium
104 Maximum Depth of Binary Tree Rust Easy
105 Construct Binary Tree from Preorder and Inorder Traversal Rust Medium
106 Construct Binary Tree from Inorder and Postorder Traversal Rust Medium
107 Binary Tree Level Order Traversal II Rust Easy
108 Convert Sorted Array to Binary Search Tree Rust Medium
109 Convert Sorted List to Binary Search Tree Rust Medium
110 Balanced Binary Tree Rust Easy
111 Minimum Depth of Binary Tree Rust Easy
112 Path Sum Rust Easy
113 Path Sum II Rust Medium
114 Flatten Binary Tree to Linked List Rust Medium
124 Binary Tree Maximum Path Sum Rust Hard
129 Sum Root to Leaf Numbers Rust Medium
144 Binary Tree Preorder Traversal Rust Medium
145 Binary Tree Postorder Traversal Rust Hard
156 Binary Tree Upside Down Rust Medium
173 Binary Search Tree Iterator Rust Medium
199 Binary Tree Right Side View Rust Medium
222 Count Complete Tree Nodes Rust Medium
226 Invert Binary Tree Rust Easy
230 Kth Smallest Element in a BST Rust Medium
250 Count Univalue Subtrees Rust Medium
255 Verify Preorder Sequence in Binary Search Tree Rust Medium
257 Binary Tree Paths Rust Easy
270 Closest Binary Search Tree Value Rust Easy
272 Closest Binary Search Tree Value II Rust Hard
298 Binary Tree Longest Consecutive Sequence Rust Medium
314 Binary Tree Vertical Order Traversal Rust Medium
331 Verify Preorder Serialization of a Binary Tree Rust Medium
333 Largest BST Subtree Rust Medium
337 House Robber III Rust Medium
366 Find Leaves of Binary Tree Rust Medium
437 Path Sum III Rust Medium
617 Merge Two Binary Trees Rust Easy
654 Two Sum IV - Input is a BST Rust Easy
1026 Maximum Difference Between Node and Ancestor Rust Medium
1145 Binary Tree Coloring Game Rust Medium
1305 All Elements in Two Binary Search Trees Rust Medium
1373 Maximum Sum BST in Binary Tree Rust Hard

Releases

No releases published

Packages

No packages published

Languages