My LeetCode Solutions!
Contributions are very welcome!
If you see an problem that you'd like to see fixed, the best way to make it happen is to help out by submitting a pull request implementing it. Refer to the CONTRIBUTING.md file for more details about the workflow.
You can also ask for problem solving ideas and discuss in GitHub issues directly.
- Learn
- Interview
# | Title | Solutions | Difficulty | Tag |
---|---|---|---|---|
14 | Longest Common Prefix | Java & Python | Easy | Introduction to String |
26 | Remove Duplicates from Sorted Array | Java & Python | Easy | Conclusion |
27 | Remove Element | Java & Go | Easy | Two-Pointer Technique |
28 | Implement strStr() | Java & Python | Easy | Introduction to String |
54 | Spiral Matrix | Java & Python | Medium | Introduction to 2D Array |
66 | Plus One | Java & Python | Easy | Introduction to Array |
67 | Add Binary | Java & Python | Easy | Introduction to String |
118 | Pascal's Triangle | Java & Python | Easy | Introduction to 2D Array |
119 | Pascal's Triangle II | Java & Python | Easy | Conclusion |
151 | Reverse Words in a String | Java & Python | Medium | Conclusion |
167 | Two Sum II - Input array is sorted | Java & Python | Easy | Two-Pointer Technique |
189 | Rotate Array | Java & Python | Easy | Conclusion |
209 | Minimum Size Subarray Sum | Java & Python | Medium | Two-Pointer Technique |
283 | Move Zeroes | Java & Python | Easy | Conclusion |
344 | Reverse String | Java & Python | Easy | Two-Pointer Technique |
485 | Max Consecutive Ones | Java & Python | Easy | Two-Pointer Technique |
498 | Diagonal Traverse | Java & Python | Medium | Introduction to 2D Array |
557 | Reverse Words in a String III | Java & Python | Easy | Conclusion |
561 | Array Partition I | Java & Python | Easy | Two-Pointer Technique |
724 | Find Pivot Index | Java & Python | Easy | Introduction to Array |
747 | Largest Number Greater Than Twice of Others | Java & Python | Easy | Introduction to Array |
# | Title | Solutions | Difficulty | Tag |
---|---|---|---|---|
20 | Valid Parentheses | Java & Python | Easy | Stack: Last-in-first-out Data Structure |
133 | Clone Graph | Java & Python | Medium | Stack and DFS |
150 | Evaluate Reverse Polish Notation | Java & Python | Medium | Stack: Last-in-first-out Data Structure |
155 | Min Stack | Java & Python | Easy | Stack: Last-in-first-out Data Structure |
200 | Number of Islands | Java & Python | Medium | Queue and BFS |
225 | Implement Stack using Queues | Java & Python | Easy | Conclusion |
232 | Implement Queue using Stacks | Java & Python | Easy | Conclusion |
279 | Perfect Squares | Java & Python | Medium | Queue and BFS |
394 | Decode String | Java & Python | Medium | Conclusion |
494 | Target Sum | Java & Python | Medium | Stack and DFS |
542 | 01 Matrix | Java & Python | Medium | Conclusion |
622 | Design Circular Queue | Java & Python | Medium | Queue: First-in-first-out Data Structure |
733 | Flood Fill | Java & Python | Easy | Conclusion |
739 | Daily Temperatures | Java & Python | Medium | Stack: Last-in-first-out Data Structure |
752 | Open the Lock | Java & Python | Medium | Queue and BFS |
841 | Keys and Rooms | Java & Python | Medium | Conclusion |
# | Title | Solutions | Difficulty | Tag |
---|---|---|---|---|
2 | Add Two Numbers | Java & Python | Medium | Conclusion |
19 | Remove Nth Node From End of List | Java & Python | Medium | Two Pointer Technique |
21 | Merge Two Sorted Lists | Java & Python | Easy | Conclusion |
61 | Rotate List | Java & Python | Medium | Conclusion |
135 | Copy List with Random Pointer | Java & Python | Medium | Conclusion |
141 | Linked List Cycle | Java & Python | Easy | Two Pointer Technique |
142 | Linked List Cycle II | Java & Python | Medium | Two Pointer Technique |
160 | Intersection of Two Linked Lists | Java & Python | Easy | Two Pointer Technique |
203 | Remove Linked List Elements | Java & Python | Easy | Classic Problems |
206 | Reverse Linked List | Java & Python | Easy | Classic Problems |
234 | Palindrome Linked List | Java & Python | Easy | Classic Problems |
328 | Odd Even Linked List | Java & Python | Medium | Classic Problems |
430 | Flatten a Multilevel Doubly Linked List | Java & Python | Medium | Conclusion |
707 | Design Linked List | Java & Python | Easy | Singly Linked List |
# | Title | Solutions | Difficulty | Tag |
---|---|---|---|---|
1 | Two Sum | Java & Python | Easy | Practical Application - Hash Map |
3 | Longest Substring Without Repeating Characters | Java & Python | Medium | Conclusion |
36 | Valid Sudoku | Java & Python | Medium | Practical Application - Design the Key |
49 | Group Anagrams | Java & Python | Medium | Practical Application - Design the Key |
136 | Single Number | Java & Python | Easy | Practical Application - Hash Set |
202 | Happy Number | Java & Python | Easy | Practical Application - Hash Set |
205 | Isomorphic Strings | Java & Python | Easy | Practical Application - Hash Map |
217 | Contains Duplicate | Java & Python | Easy | Practical Application - Hash Set |
219 | Contains Duplicate II | Java & Python | Easy | Practical Application - Hash Map |
347 | Top K Frequent Elements | Java & Python | Medium | Conclusion |
349 | Intersection of Two Arrays | Java & Python | Easy | Practical Application - Hash Set |
350 | Intersection of Two Arrays II | Java & Python | Easy | Practical Application - Hash Map |
380 | Insert Delete GetRandom O(1) | Java & Python | Medium | Conclusion |
387 | First Unique Character in a String | Java & Python | Easy | Practical Application - Hash Map |
454 | 4Sum II | Java & Python | Medium | Conclusion |
599 | Minimum Index Sum of Two Lists | Java & Python | Easy | Practical Application - Hash Map |
652 | Find Duplicate Subtrees | Java & Python | Medium | Practical Application - Design the Key |
705 | Design HashSet | Java & Python | Easy | Design a Hash Table |
706 | Design HashMap | Java & Python | Easy | Design a Hash Table |
771 | Jewels and Stones | Java & Python | Easy | Conclusion |
# | Title | Solutions | Difficulty | Tag |
---|---|---|---|---|
4 | Median of Two Sorted Arrays | Java & Python | Hard | More Practices II |
33 | Search in Rotated Sorted Array | Java & Python | Medium | Template I |
34 | Find First and Last Position of Element in Sorted Array | Java & Python | Medium | Template III |
50 | Pow(x, n) | Java & Python | Medium | Conclusion |
69 | Sqrt(x) | Java & Python | Easy | Template I |
153 | Find Minimum in Rotated Sorted Array | Java & Python | Medium | Template II |
154 | Find Minimum in Rotated Sorted Array II | Java & Python | Hard | More Practices |
162 | Find Peak Element | Java & Python | Medium | Template II |
167 | Two Sum II - Input array is sorted | Java & Python | Easy | More Practices |
278 | First Bad Version | Java & Python | Easy | Template II |
287 | Find the Duplicate Number | Java & Python | Medium | More Practices II |
349 | Intersection of Two Arrays | Java & Python | Easy | More Practices |
350 | Intersection of Two Arrays II | Java & Python | Easy | More Practices |
367 | Valid Perfect Square | Java & Python | Easy | Conclusion |
374 | Guess Number Higher or Lower | Java & Python | Easy | Template I |
410 | Split Array Largest Sum | Java & Python | Hard | More Practices II |
658 | Find K Closest Elements | Java & Python | Medium | Template III |
704 | Binary Search | Java & Python | Easy | Background |
719 | Find K-th Smallest Pair Distance | Java & Python | Hard | More Practices II |
744 | Find Smallest Letter Greater Than Target | Java & Python | Easy | Conclusion |
# | Title | Solutions | Difficulty | Tag |
---|---|---|---|---|
94 | Binary Tree Inorder Traversal | Java & Python | Medium | Traverse A Tree |
101 | Symmetric Tree | Java & Python | Easy | Solve Tree Problems Recursively |
102 | Binary Tree Level Order Traversal | Java & Python | Medium | Traverse A Tree |
104 | Maximum Depth of Binary Tree | Java & Python | Easy | Solve Tree Problems Recursively |
105 | Construct Binary Tree from Preorder and Inorder Traversal | Java & Python | Medium | Conclusion |
106 | Construct Binary Tree from Inorder and Postorder Traversal | Java & Python | Medium | Conclusion |
112 | Path Sum | Java & Python | Easy | Solve Tree Problems Recursively |
116 | Populating Next Right Pointers in Each Node | Java & Python | Medium | Conclusion |
117 | Populating Next Right Pointers in Each Node II | Java & Python | Medium | Conclusion |
144 | Binary Tree Preorder Traversal | Java & Python | Medium | Traverse A Tree |
145 | Binary Tree Postorder Traversal | Java & Python | Hard | Traverse A Tree |
236 | Lowest Common Ancestor of a Binary Tree | Java & Python | Medium | Conclusion |
297 | Serialize and Deserialize Binary Tree | Java & Python | Medium | Conclusion |
# | Title | Solutions | Difficulty | Tag |
---|---|---|---|---|
98 | Validate Binary Search Tree | Java & Python | Medium | Introduction to BST |
108 | Convert Sorted Array to Binary Search Tree | Java & Python | Easy | Appendix: Height-balanced BST |
110 | Balanced Binary Tree | Java & Python | Easy | Appendix: Height-balanced BST |
173 | Binary Search Tree Iterator | Java & Python | Medium | Introduction to BST |
220 | Contains Duplicate III | Java & Python | Medium | Conclusion |
235 | Lowest Common Ancestor of a Binary Search Tree | Java & Python | Easy | Conclusion |
450 | Delete Node in a BST | Java & Python | Medium | Basic Operations in BST |
700 | Search in a Binary Search Tree | Java & Python | Easy | Basic Operations in BST |
701 | Insert into a Binary Search Tree | Java & Python | Medium | Basic Operations in BST |
703 | Kth Largest Element in a Stream | Java & Python | Easy | Conclusion |
# | Title | Solutions | Difficulty | Tag |
---|---|---|---|---|
429 | N-ary Tree Level Order Traversal | Java & Python | Easy | Traversal |
559 | Maximum Depth of N-ary Tree | Java & Python | Easy | Recursion |
589 | N-ary Tree Preorder Traversal | Java & Python | Easy | Traversal |
590 | N-ary Tree Postorder Traversal | Java & Python | Easy | Traversal |
# | Title | Solutions | Difficulty | Tag |
---|---|---|---|---|
208 | Implement Trie (Prefix Tree) | Java & Python | Medium | Basic Operations |
211 | Add and Search Word - Data structure design | Java & Python | Medium | Practical Application I |
212 | Word Search II | Java & Python | Hard | Practical Application II |
336 | Palindrome Pairs | Java & Python | Hard | Practical Application II |
421 | Maximum XOR of Two Numbers in an Array | Java & Python | Medium | Practical Application II |
648 | Replace Words | Java & Python | Medium | Practical Application I |
677 | Map Sum Pairs | Java & Python | Medium | Practical Application I |
# | Title | Solutions | Difficulty | Tag |
---|---|---|---|---|
### | Calculate Entropy | Java & Python | Easy | Implementation |
### | Calculate Maximum Information Gain | Java & Python | Easy | Implementation |
# | Title | Solutions | Difficulty | Tag |
---|---|---|---|---|
21 | Merge Two Sorted Lists | Java & Python | Easy | Conclusion |
24 | Swap Nodes in Pairs | Java & Python | Medium | Principle of Recursion |
50 | Pow(x, n) | Java & Python | Medium | Complexity Analysis |
70 | Climbing Stairs | Java & Python | Easy | Memoization |
95 | Unique Binary Search Trees II | Java & Python | Medium | Conclusion |
104 | Maximum Depth of Binary Tree | Java & Python | Easy | Complexity Analysis |
118 | Pascal's Triangle | Java & Python | Easy | Recurrence Relation |
119 | Pascal's Triangle II | Java & Python | Easy | Recurrence Relation |
206 | Reverse Linked List | Java & Python | Easy | Recurrence Relation |
344 | Reverse String | Java & Python | Easy | Principle of Recursion |
509 | Fibonacci Number | Java & Python | Easy | Memoization |
779 | K-th Symbol in Grammar | Java & Python | Medium | Conclusion |
# | Title | Solutions | Difficulty | Tag |
---|---|---|---|---|
17 | Letter Combinations of a Phone Number | Java & Python | Medium | Conclusion |
22 | Generate Parentheses | Java & Python | Medium | Recursion to Iteration |
37 | Sudoku Solver | Java & Python | Hard | Backtracking |
46 | Permutations | Java & Python | Medium | Conclusion |
52 | N-Queens II | Java & Python | Hard | Backtracking |
77 | Combinations | Java & Python | Medium | Backtracking |
84 | Largest Rectangle in Histogram | Java & Python | Hard | Conclusion |
94 | Binary Tree Inorder Traversal | Java & Python | Medium | Recursion to Iteration |
98 | Validate Binary Search Tree | Java & Python | Medium | Divide and Conquer |
100 | Same Tree | Java & Python | Easy | Recursion to Iteration |
102 | Binary Tree Level Order Traversal | Java & Python | Medium | Recursion to Iteration |
218 | The Skyline Problem | Java & Python | Hard | Conclusion |
240 | Search a 2D Matrix II | Java & Python | Medium | Divide and Conquer |
912 | Sort an Array | Java & Python | Medium | Divide and Conquer |
# | Title | Solutions | Difficulty | Tag |
---|---|---|---|---|
1114 | Print in Order | Java & Python | Easy | Concurrency |
1115 | Print FooBar Alternately | Java & Python | Medium | Concurrency |
1116 | Print Zero Even Odd | Java & Python | Medium | Concurrency |
1117 | Building H2O | Java & Python | Medium | Concurrency |
1195 | Fizz Buzz Multithreaded | Java & Python | Medium | Concurrency |
1226 | The Dining Philosophers | Java & Python | Medium | Concurrency |
# | Title | Solutions | Difficulty | Tag |
---|---|---|---|---|
6 | ZigZag Conversion | Java & Python | Medium | Others |
9 | Palindrome Number | Java & Python | Easy | Others |
12 | Integer to Roman | Java & Python | Medium | Others |
16 | 3Sum Closest | Java & Python | Medium | Others |
18 | 4Sum | Java & Python | Medium | Others |
25 | Reverse Nodes in k-Group | Java & Python | Hard | Others |
30 | Substring with Concatenation of All Words | Java & Python | Hard | Others |
31 | Next Permutation | Java & Python | Medium | Others |
32 | Longest Valid Parentheses | Java & Python | Hard | Others |
35 | Search Insert Position | Java & Python | Easy | Others |
39 | Combination Sum | Java & Python | Medium | Others |
40 | Combination Sum II | Java & Python | Medium | Others |
43 | Multiply Strings | Java & Python | Medium | Others |
45 | Jump Game II | Java & Python | Hard | Others |
47 | Permutations II | Java & Python | Medium | Others |
51 | N-Queens | Java & Python | Hard | Others |
57 | Insert Interval | Java & Python | Hard | Others |
58 | Length of Last Word | Java & Python | Easy | Others |
59 | Spiral Matrix II | Java & Python | Medium | Others |
60 | Permutation Sequence | Java & Python | Medium | Others |
63 | Unique Paths II | Java & Python | Medium | Others |
64 | Minimum Path Sum | Java & Python | Medium | Others |
65 | Valid Number | Java & Python | Hard | Others |
68 | Text Justification | Java & Python | Hard | Others |
71 | Simplify Path | Java & Python | Medium | Others |
72 | Edit Distance | Java & Python | Hard | Others |
74 | Search a 2D Matrix | Java & Python | Medium | Others |
80 | Remove Duplicates from Sorted Array II | Java & Python | Medium | Others |
81 | Search in Rotated Sorted Array II | Java & Python | Medium | Others |
82 | Remove Duplicates from Sorted List II | Java & Python | Medium | Others |
83 | Remove Duplicates from Sorted List | Java & Python | Easy | Others |
85 | Maximal Rectangle | Java & Python | Hard | Others |
86 | Partition List | Java & Python | Medium | Others |
87 | Scramble String | Java & Python | Hard | Others |
89 | Gray Code | Java & Python | Medium | Others |
90 | Subsets II | Java & Python | Medium | Others |
92 | Reverse Linked List II | Java & Python | Medium | Others |
93 | Restore IP Addresses | Java & Python | Medium | Others |
96 | Unique Binary Search Trees | Java & Python | Medium | Others |
97 | Interleaving String | Java & Python | Hard | Others |
99 | Recover Binary Search Tree | Java & Python | Hard | Others |
107 | Binary Tree Level Order Traversal II | Java & Python | Easy | Others |
109 | Convert Sorted List to Binary Search Tree | Java & Python | Medium | Others |
111 | Minimum Depth of Binary Tree | Java & Python | Easy | Others |
113 | Path Sum II | Java & Python | Medium | Others |
114 | Flatten Binary Tree to Linked List | Java & Python | Medium | Others |
115 | Distinct Subsequences | Java & Python | Hard | Others |
120 | Triangle | Java & Python | Medium | Others |
123 | Best Time to Buy and Sell Stock III | Java & Python | Hard | Others |
126 | Word Ladder II | Java & Python | Hard | Others |
129 | Sum Root to Leaf Numbers | Java & Python | Medium | Others |
132 | Palindrome Partitioning II | Java & Python | Hard | Others |
134 | Gas Station | Java & Python | Medium | Others |
135 | Candy | Java & Python | Hard | Others |
137 | Single Number II | Java & Python | Medium | Others |
143 | Reorder List | Java & Python | Medium | Others |
147 | Insertion Sort List | Java & Python | Medium | Others |
164 | Maximum Gap | Java & Python | Hard | Others |
165 | Compare Version Numbers | Java & Python | Medium | Others |
168 | Excel Sheet Column Title | Java & Python | Easy | Others |
174 | Dungeon Game | Java & Python | Hard | Others |
187 | Repeated DNA Sequences | Java & Python | Medium | Others |
188 | Best Time to Buy and Sell Stock IV | Java & Python | Hard | Others |
199 | Binary Tree Right Side View | Java & Python | Medium | Others |
201 | Bitwise AND of Numbers Range | Java & Python | Medium | Others |
213 | House Robber II | Java & Python | Medium | Others |
214 | Shortest Palindrome | Java & Python | Hard | Others |
216 | Combination Sum III | Java & Python | Medium | Others |
221 | Maximal Square | Java & Python | Medium | Others |
222 | Count Complete Tree Nodes | Java & Python | Medium | Others |
223 | Rectangle Area | Java & Python | Medium | Others |
224 | Basic Calculator | Java & Python | Hard | Others |
226 | Invert Binary Tree | Java & Python | Easy | Others |
228 | Summary Ranges | Java & Python | Medium | Others |
229 | Majority Element II | Java & Python | Medium | Others |
231 | Power of Two | Java & Python | Easy | Others |
233 | Number of Digit One | Java & Python | Hard | Others |
241 | Different Ways to Add Parentheses | Java & Python | Medium | Others |
257 | Binary Tree Paths | Java & Python | Easy | Others |
258 | Add Digits | Java & Python | Easy | Others |
260 | Single Number III | Java & Python | Medium | Others |
263 | Ugly Number | Java & Python | Easy | Others |
264 | Ugly Number II | Java & Python | Medium | Others |
273 | Integer to English Words | Java & Python | Hard | Others |
274 | H-Index | Java & Python | Medium | Others |
275 | H-Index II | Java & Python | Medium | Others |
282 | Expression Add Operators | Java & Python | Hard | Others |
284 | Peeking Iterator | Java & Python | Medium | Others |
290 | Word Pattern | Java & Python | Easy | Others |
292 | Nim Game | Java & Python | Easy | Others |
299 | Bulls and Cows | Java & Python | Easy | Others |
303 | Range Sum Query - Immutable | Java & Python | Easy | Others |
304 | Range Sum Query 2D - Immutable | Java & Python | Medium | Others |
306 | Additive Number | Java & Python | Medium | Others |
307 | Range Sum Query - Mutable | Java & Python | Medium | Others |
310 | Minimum Height Trees | Java & Python | Medium | Others |
313 | Super Ugly Number | Java & Python | Medium | Others |
316 | Remove Duplicate Letters | Java & Python | Hard | Others |
318 | Maximum Product of Word Lengths | Java & Python | Medium | Others |
319 | Bulb Switcher | Java & Python | Medium | Others |
321 | Create Maximum Number | Java & Python | Hard | Others |
327 | Count of Range Sum | Java & Python | Hard | Others |
330 | Patching Array | Java & Python | Hard | Others |
331 | Verify Preorder Serialization of a Binary Tree | Java & Python | Medium | Others |
332 | Reconstruct Itinerary | Java & Python | Medium | Others |
335 | Self Crossing | Java & Python | Hard | Others |
337 | House Robber III | Java & Python | Medium | Others |
338 | Counting Bits | Java & Python | Medium | Others |
342 | Power of Four | Java & Python | Easy | Others |
343 | Integer Break | Java & Python | Medium | Others |
345 | Reverse Vowels of a String | Java & Python | Easy | Others |
352 | Data Stream as Disjoint Intervals | Java & Python | Hard | Others |
354 | Russian Doll Envelopes | Java & Python | Hard | Others |
355 | Design Twitter | Java & Python | Medium | Others |
357 | Count Numbers with Unique Digits | Java & Python | Medium | Others |
363 | Max Sum of Rectangle No Larger Than K | Java & Python | Hard | Others |
365 | Water and Jug Problem | Java & Python | Medium | Others |
368 | Largest Divisible Subset | Java & Python | Medium | Others |
372 | Super Pow | Java & Python | Medium | Others |
373 | Find K Pairs with Smallest Sums | Java & Python | Medium | Others |
375 | Guess Number Higher or Lower II | Java & Python | Medium | Others |
376 | Wiggle Subsequence | Java & Python | Medium | Others |
377 | Combination Sum IV | Java & Python | Medium | Others |
381 | Insert Delete GetRandom O(1) - Duplicates allowed | Java & Python | Hard | Others |
382 | Linked List Random Node | Java & Python | Medium | Others |
383 | Ransom Note | Java & Python | Easy | Others |
385 | Mini Parser | Java & Python | Medium | Others |
386 | Lexicographical Numbers | Java & Python | Medium | Others |
388 | Longest Absolute File Path | Java & Python | Medium | Others |
389 | Find the Difference | Java & Python | Easy | Others |
390 | Elimination Game | Java & Python | Medium | Others |
391 | Perfect Rectangle | Java & Python | Hard | Others |
392 | Is Subsequence | Java & Python | Easy | Others |
393 | UTF-8 Validation | Java & Python | Medium | Others |
395 | Longest Substring with At Least K Repeating Characters | Java & Python | Medium | Others |
396 | Rotate Function | Java & Python | Medium | Others |
397 | Integer Replacement | Java & Python | Medium | Others |
398 | Random Pick Index | Java & Python | Medium | Others |
399 | Evaluate Division | Java & Python | Medium | Others |
400 | Nth Digit | Java & Python | Medium | Others |
401 | Binary Watch | Java & Python | Easy | Others |
402 | Remove K Digits | Java & Python | Medium | Others |
403 | Frog Jump | Java & Python | Hard | Others |
404 | Sum of Left Leaves | Java & Python | Easy | Others |
405 | Convert a Number to Hexadecimal | Java & Python | Easy | Others |
407 | Trapping Rain Water II | Java & Python | Hard | Others |
409 | Longest Palindrome | Java & Python | Easy | Others |
413 | Arithmetic Slices | Java & Python | Medium | Others |
414 | Third Maximum Number | Java & Python | Easy | Others |
415 | Add Strings | Java & Python | Easy | Others |
416 | Partition Equal Subset Sum | Java & Python | Medium | Others |
417 | Pacific Atlantic Water Flow | Java & Python | Medium | Others |
419 | Battleships in a Board | Java & Python | Medium | Others |
420 | Strong Password Checker | Java & Python | Hard | Others |
423 | Reconstruct Original Digits from English | Java & Python | Medium | Others |
424 | Longest Repeating Character Replacement | Java & Python | Medium | Others |
427 | Construct Quad Tree | Java & Python | Medium | Others |
432 | All O`one Data Structure | Java & Python | Hard | Others |
433 | Minimum Genetic Mutation | Java & Python | Medium | Others |
434 | Number of Segments in a String | Java & Python | Easy | Others |
435 | Non-overlapping Intervals | Java & Python | Medium | Others |
436 | Find Right Interval | Java & Python | Medium | Others |
437 | Path Sum III | Java & Python | Easy | Others |
438 | Find All Anagrams in a String | Java & Python | Medium | Others |
440 | K-th Smallest in Lexicographical Order | Java & Python | Hard | Others |
441 | Arranging Coins | Java & Python | Easy | Others |
442 | Find All Duplicates in an Array | Java & Python | Medium | Others |
443 | String Compression | Java & Python | Easy | Others |
445 | Add Two Numbers II | Java & Python | Medium | Others |
446 | Arithmetic Slices II - Subsequence | Java & Python | Hard | Others |
447 | Number of Boomerangs | Java & Python | Easy | Others |
448 | Find All Numbers Disappeared in an Array | Java & Python | Easy | Others |
449 | Serialize and Deserialize BST | Java & Python | Medium | Others |
451 | Sort Characters By Frequency | Java & Python | Medium | Others |
452 | Minimum Number of Arrows to Burst Balloons | Java & Python | Medium | Others |
453 | Minimum Moves to Equal Array Elements | Java & Python | Easy | Others |
455 | Assign Cookies | Java & Python | Easy | Others |
456 | 132 Pattern | Java & Python | Medium | Others |
457 | Circular Array Loop | Java & Python | Medium | Others |
458 | Poor Pigs | Java & Python | Hard | Others |
459 | Repeated Substring Pattern | Java & Python | Easy | Others |
460 | LFU Cache | Java & Python | Hard | Others |
462 | Minimum Moves to Equal Array Elements II | Java & Python | Medium | Others |
463 | Island Perimeter | Java & Python | Easy | Others |
464 | Can I Win | Java & Python | Medium | Others |
466 | Count The Repetitions | Java & Python | Hard | Others |
467 | Unique Substrings in Wraparound String | Java & Python | Medium | Others |
468 | Validate IP Address | Java & Python | Medium | Others |
470 | Implement Rand10() Using Rand7() | Java & Python | Medium | Others |
472 | Concatenated Words | Java & Python | Hard | Others |
473 | Matchsticks to Square | Java & Python | Medium | Others |
474 | Ones and Zeroes | Java & Python | Medium | Others |
475 | Heaters | Java & Python | Easy | Others |
476 | Number Complement | Java & Python | Easy | Others |
477 | Total Hamming Distance | Java & Python | Medium | Others |
478 | Generate Random Point in a Circle | Java & Python | Medium | Others |
479 | Largest Palindrome Product | Java & Python | Hard | Others |
480 | Sliding Window Median | Java & Python | Hard | Others |
481 | Magical String | Java & Python | Medium | Others |
482 | License Key Formatting | Java & Python | Easy | Others |
483 | Smallest Good Base | Java & Python | Hard | Others |
486 | Predict the Winner | Java & Python | Medium | Others |
488 | Zuma Game | Java & Python | Hard | Others |
491 | Increasing Subsequences | Java & Python | Medium | Others |
492 | Construct the Rectangle | Java & Python | Easy | Others |
493 | Reverse Pairs | Java & Python | Hard | Others |
495 | Teemo Attacking | Java & Python | Medium | Others |
496 | Next Greater Element I | Java & Python | Easy | Others |
497 | Random Point in Non-overlapping Rectangles | Java & Python | Medium | Others |
500 | Keyboard Row | Java & Python | Easy | Others |
501 | Find Mode in Binary Search Tree | Java & Python | Easy | Others |
502 | IPO | Java & Python | Hard | Others |
503 | Next Greater Element II | Java & Python | Medium | Others |
504 | Base 7 | Java & Python | Easy | Others |
506 | Relative Ranks | Java & Python | Easy | Others |
507 | Perfect Number | Java & Python | Easy | Others |
508 | Most Frequent Subtree Sum | Java & Python | Medium | Others |
513 | Find Bottom Left Tree Value | Java & Python | Medium | Others |
514 | Freedom Trail | Java & Python | Hard | Others |
515 | Find Largest Value in Each Tree Row | Java & Python | Medium | Others |
516 | Longest Palindromic Subsequence | Java & Python | Medium | Others |
517 | Super Washing Machines | Java & Python | Hard | Others |
518 | Coin Change 2 | Java & Python | Medium | Others |
519 | Random Flip Matrix | Java & Python | Medium | Others |
520 | Detect Capital | Java & Python | Easy | Others |
521 | Longest Uncommon Subsequence I | Java & Python | Easy | Others |
522 | Longest Uncommon Subsequence II | Java & Python | Medium | Others |
523 | Continuous Subarray Sum | Java & Python | Medium | Others |
524 | Longest Word in Dictionary through Deleting | Java & Python | Medium | Others |
525 | Contiguous Array | Java & Python | Medium | Others |
526 | Beautiful Arrangement | Java & Python | Medium | Others |
528 | Random Pick with Weight | Java & Python | Medium | Others |
529 | Minesweeper | Java & Python | Medium | Others |
530 | Minimum Absolute Difference in BST | Java & Python | Easy | Others |
532 | K-diff Pairs in an Array | Java & Python | Easy | Others |
535 | Encode and Decode TinyURL | Java & Python | Medium | Others |
537 | Complex Number Multiplication | Java & Python | Medium | Others |
538 | Convert BST to Greater Tree | Java & Python | Easy | Others |
539 | Minimum Time Difference | Java & Python | Medium | Others |
540 | Single Element in a Sorted Array | Java & Python | Medium | Others |
541 | Reverse String II | Java & Python | Easy | Others |
543 | Diameter of Binary Tree | Java & Python | Easy | Others |
546 | Remove Boxes | Java & Python | Hard | Others |
551 | Student Attendance Record I | Java & Python | Easy | Others |
552 | Student Attendance Record II | Java & Python | Hard | Others |
553 | Optimal Division | Java & Python | Medium | Others |
554 | Brick Wall | Java & Python | Medium | Others |
556 | Next Greater Element III | Java & Python | Medium | Others |
558 | Quad Tree Intersection | Java & Python | Easy | Others |
560 | Subarray Sum Equals K | Java & Python | Medium | Others |
563 | Binary Tree Tilt | Java & Python | Easy | Others |
564 | Find the Closest Palindrome | Java & Python | Hard | Others |
565 | Array Nesting | Java & Python | Medium | Others |
566 | Reshape the Matrix | Java & Python | Easy | Others |
567 | Permutation in String | Java & Python | Medium | Others |
572 | Subtree of Another Tree | Java & Python | Easy | Others |
575 | Distribute Candies | Java & Python | Easy | Others |
576 | Out of Boundary Paths | Java & Python | Medium | Others |
581 | Shortest Unsorted Continuous Subarray | Java & Python | Easy | Others |
583 | Delete Operation for Two Strings | Java & Python | Medium | Others |
587 | Erect the Fence | Java & Python | Hard | Others |
591 | Tag Validator | Java & Python | Hard | Others |
592 | Fraction Addition and Subtraction | Java & Python | Medium | Others |
593 | Valid Square | Java & Python | Medium | Others |
594 | Longest Harmonious Subsequence | Java & Python | Easy | Others |
598 | Range Addition II | Java & Python | Easy | Others |
600 | Non-negative Integers without Consecutive Ones | Java & Python | Hard | Others |
605 | Can Place Flowers | Java & Python | Easy | Others |
606 | Construct String from Binary Tree | Java & Python | Easy | Others |
609 | Find Duplicate File in System | Java & Python | Medium | Others |
611 | Valid Triangle Number | Java & Python | Medium | Others |
617 | Merge Two Binary Trees | Java & Python | Easy | Others |
623 | Add One Row to Tree | Java & Python | Medium | Others |
628 | Maximum Product of Three Numbers | Java & Python | Easy | Others |
629 | K Inverse Pairs Array | Java & Python | Hard | Others |
630 | Course Schedule III | Java & Python | Hard | Others |
632 | Smallest Range Covering Elements from K Lists | Java & Python | Hard | Others |
633 | Sum of Square Numbers | Java & Python | Easy | Others |
636 | Exclusive Time of Functions | Java & Python | Medium | Others |
637 | Average of Levels in Binary Tree | Java & Python | Easy | Others |
638 | Shopping Offers | Java & Python | Medium | Others |
639 | Decode Ways II | Java & Python | Hard | Others |
640 | Solve the Equation | Java & Python | Medium | Others |
641 | Design Circular Deque | Java & Python | Medium | Others |
643 | Maximum Average Subarray I | Java & Python | Easy | Others |
645 | Set Mismatch | Java & Python | Easy | Others |
646 | Maximum Length of Pair Chain | Java & Python | Medium | Others |
647 | Palindromic Substrings | Java & Python | Medium | Others |
649 | Dota2 Senate | Java & Python | Medium | Others |
650 | 2 Keys Keyboard | Java & Python | Medium | Others |
653 | Two Sum IV - Input is a BST | Java & Python | Easy | Others |
654 | Maximum Binary Tree | Java & Python | Medium | Others |
655 | Print Binary Tree | Java & Python | Medium | Others |
657 | Robot Return to Origin | Java & Python | Easy | Others |
659 | Split Array into Consecutive Subsequences | Java & Python | Medium | Others |
661 | Image Smoother | Java & Python | Easy | Others |
662 | Maximum Width of Binary Tree | Java & Python | Medium | Others |
664 | Strange Printer | Java & Python | Hard | Others |
665 | Non-decreasing Array | Java & Python | Easy | Others |
667 | Beautiful Arrangement II | Java & Python | Medium | Others |
668 | Kth Smallest Number in Multiplication Table | Java & Python | Hard | Others |
669 | Trim a Binary Search Tree | Java & Python | Easy | Others |
670 | Maximum Swap | Java & Python | Medium | Others |
671 | Second Minimum Node In a Binary Tree | Java & Python | Easy | Others |
672 | Bulb Switcher II | Java & Python | Medium | Others |
673 | Number of Longest Increasing Subsequence | Java & Python | Medium | Others |
674 | Longest Continuous Increasing Subsequence | Java & Python | Easy | Others |
675 | Cut Off Trees for Golf Event | Java & Python | Hard | Others |
676 | Implement Magic Dictionary | Java & Python | Medium | Others |
678 | Valid Parenthesis String | Java & Python | Medium | Others |
679 | 24 Game | Java & Python | Hard | Others |
680 | Valid Palindrome II | Java & Python | Easy | Others |
682 | Baseball Game | Java & Python | Easy | Others |
684 | Redundant Connection | Java & Python | Medium | Others |
685 | Redundant Connection II | Java & Python | Hard | Others |
686 | Repeated String Match | Java & Python | Easy | Others |
687 | Longest Univalue Path | Java & Python | Easy | Others |
688 | Knight Probability in Chessboard | Java & Python | Medium | Others |
689 | Maximum Sum of 3 Non-Overlapping Subarrays | Java & Python | Hard | Others |
690 | Employee Importance | Java & Python | Easy | Others |
691 | Stickers to Spell Word | Java & Python | Hard | Others |
692 | Top K Frequent Words | Java & Python | Medium | Others |
693 | Binary Number with Alternating Bits | Java & Python | Easy | Others |
695 | Max Area of Island | Java & Python | Medium | Others |
696 | Count Binary Substrings | Java & Python | Easy | Others |
697 | Degree of an Array | Java & Python | Easy | Others |
698 | Partition to K Equal Sum Subsets | Java & Python | Medium | Others |
699 | Falling Squares | Java & Python | Hard | Others |
709 | To Lower Case | Java & Python | Easy | Others |
710 | Random Pick with Blacklist | Java & Python | Hard | Others |
712 | Minimum ASCII Delete Sum for Two Strings | Java & Python | Medium | Others |
713 | Subarray Product Less Than K | Java & Python | Medium | Others |
714 | Best Time to Buy and Sell Stock with Transaction Fee | Java & Python | Medium | Others |
715 | Range Module | Java & Python | Hard | Others |
717 | 1-bit and 2-bit Characters | Java & Python | Easy | Others |
718 | Maximum Length of Repeated Subarray | Java & Python | Medium | Others |
720 | Longest Word in Dictionary | Java & Python | Easy | Others |
721 | Accounts Merge | Java & Python | Medium | Others |
722 | Remove Comments | Java & Python | Medium | Others |
725 | Split Linked List in Parts | Java & Python | Medium | Others |
726 | Number of Atoms | Java & Python | Hard | Others |
728 | Self Dividing Numbers | Java & Python | Easy | Others |
729 | My Calendar I | Java & Python | Medium | Others |
730 | Count Different Palindromic Subsequences | Java & Python | Hard | Others |
731 | My Calendar II | Java & Python | Medium | Others |
732 | My Calendar III | Java & Python | Hard | Others |
735 | Asteroid Collision | Java & Python | Medium | Others |
736 | Parse Lisp Expression | Java & Python | Hard | Others |
738 | Monotone Increasing Digits | Java & Python | Medium | Others |
740 | Delete and Earn | Java & Python | Medium | Others |
741 | Cherry Pickup | Java & Python | Hard | Others |
743 | Network Delay Time | Java & Python | Medium | Others |
745 | Prefix and Suffix Search | Java & Python | Hard | Others |
746 | Min Cost Climbing Stairs | Java & Python | Easy | Others |
748 | Shortest Completing Word | Java & Python | Easy | Others |
749 | Contain Virus | Java & Python | Hard | Others |
753 | Cracking the Safe | Java & Python | Hard | Others |
754 | Reach a Number | Java & Python | Easy | Others |
756 | Pyramid Transition Matrix | Java & Python | Medium | Others |
757 | Set Intersection Size At Least Two | Java & Python | Hard | Others |
761 | Special Binary String | Java & Python | Hard | Others |
762 | Prime Number of Set Bits in Binary Representation | Java & Python | Easy | Others |
763 | Partition Labels | Java & Python | Medium | Others |
764 | Largest Plus Sign | Java & Python | Medium | Others |
765 | Couples Holding Hands | Java & Python | Hard | Others |
766 | Toeplitz Matrix | Java & Python | Easy | Others |
767 | Reorganize String | Java & Python | Medium | Others |
768 | Max Chunks To Make Sorted II | Java & Python | Hard | Others |
769 | Max Chunks To Make Sorted | Java & Python | Medium | Others |
770 | Basic Calculator IV | Java & Python | Hard | Others |
773 | Sliding Puzzle | Java & Python | Hard | Others |
775 | Global and Local Inversions | Java & Python | Medium | Others |
777 | Swap Adjacent in LR String | Java & Python | Medium | Others |
778 | Swim in Rising Water | Java & Python | Hard | Others |
780 | Reaching Points | Java & Python | Hard | Others |
781 | Rabbits in Forest | Java & Python | Medium | Others |
782 | Transform to Chessboard | Java & Python | Hard | Others |
783 | Minimum Distance Between BST Nodes | Java & Python | Easy | Others |
784 | Letter Case Permutation | Java & Python | Easy | Others |
785 | Is Graph Bipartite? | Java & Python | Medium | Others |
786 | K-th Smallest Prime Fraction | Java & Python | Hard | Others |
787 | Cheapest Flights Within K Stops | Java & Python | Medium | Others |
788 | Rotated Digits | Java & Python | Easy | Others |
789 | Escape The Ghosts | Java & Python | Medium | Others |
790 | Domino and Tromino Tiling | Java & Python | Medium | Others |
791 | Custom Sort String | Java & Python | Medium | Others |
792 | Number of Matching Subsequences | Java & Python | Medium | Others |
793 | Preimage Size of Factorial Zeroes Function | Java & Python | Hard | Others |
794 | Valid Tic-Tac-Toe State | Java & Python | Medium | Others |
795 | Number of Subarrays with Bounded Maximum | Java & Python | Medium | Others |
796 | Rotate String | Java & Python | Easy | Others |
797 | All Paths From Source to Target | Java & Python | Medium | Others |
798 | Smallest Rotation with Highest Score | Java & Python | Hard | Others |
799 | Champagne Tower | Java & Python | Medium | Others |
801 | Minimum Swaps To Make Sequences Increasing | Java & Python | Medium | Others |
802 | Find Eventual Safe States | Java & Python | Medium | Others |
803 | Bricks Falling When Hit | Java & Python | Hard | Others |
804 | Unique Morse Code Words | Java & Python | Easy | Others |
805 | Split Array With Same Average | Java & Python | Hard | Others |
806 | Number of Lines To Write String | Java & Python | Easy | Others |
807 | Max Increase to Keep City Skyline | Java & Python | Medium | Others |
808 | Soup Servings | Java & Python | Medium | Others |
809 | Expressive Words | Java & Python | Medium | Others |
810 | Chalkboard XOR Game | Java & Python | Hard | Others |
811 | Subdomain Visit Count | Java & Python | Easy | Others |
812 | Largest Triangle Area | Java & Python | Easy | Others |
813 | Largest Sum of Averages | Java & Python | Medium | Others |
814 | Binary Tree Pruning | Java & Python | Medium | Others |
815 | Bus Routes | Java & Python | Hard | Others |
816 | Ambiguous Coordinates | Java & Python | Medium | Others |
817 | Linked List Components | Java & Python | Medium | Others |
818 | Race Car | Java & Python | Hard | Others |
819 | Most Common Word | Java & Python | Easy | Others |
820 | Short Encoding of Words | Java & Python | Medium | Others |
821 | Shortest Distance to a Character | Java & Python | Easy | Others |
822 | Card Flipping Game | Java & Python | Medium | Others |
823 | Binary Trees With Factors | Java & Python | Medium | Others |
824 | Goat Latin | Java & Python | Easy | Others |
825 | Friends Of Appropriate Ages | Java & Python | Medium | Others |
826 | Most Profit Assigning Work | Java & Python | Medium | Others |
827 | Making A Large Island | Java & Python | Hard | Others |
828 | Unique Letter String | Java & Python | Hard | Others |
829 | Consecutive Numbers Sum | Java & Python | Hard | Others |
830 | Positions of Large Groups | Java & Python | Easy | Others |
831 | Masking Personal Information | Java & Python | Medium | Others |
832 | Flipping an Image | Java & Python | Easy | Others |
833 | Find And Replace in String | Java & Python | Medium | Others |
834 | Sum of Distances in Tree | Java & Python | Hard | Others |
835 | Image Overlap | Java & Python | Medium | Others |
836 | Rectangle Overlap | Java & Python | Easy | Others |
837 | New 21 Game | Java & Python | Medium | Others |
838 | Push Dominoes | Java & Python | Medium | Others |
839 | Similar String Groups | Java & Python | Hard | Others |
840 | Magic Squares In Grid | Java & Python | Easy | Others |
842 | Split Array into Fibonacci Sequence | Java & Python | Medium | Others |
843 | Guess the Word | Java & Python | Hard | Others |
844 | Backspace String Compare | Java & Python | Easy | Others |
845 | Longest Mountain in Array | Java & Python | Medium | Others |
846 | Hand of Straights | Java & Python | Medium | Others |
847 | Shortest Path Visiting All Nodes | Java & Python | Hard | Others |
848 | Shifting Letters | Java & Python | Medium | Others |
849 | Maximize Distance to Closest Person | Java & Python | Easy | Others |
850 | Rectangle Area II | Java & Python | Hard | Others |
851 | Loud and Rich | Java & Python | Medium | Others |
852 | Peak Index in a Mountain Array | Java & Python | Easy | Others |
853 | Car Fleet | Java & Python | Medium | Others |
854 | K-Similar Strings | Java & Python | Hard | Others |
855 | Exam Room | Java & Python | Medium | Others |
856 | Score of Parentheses | Java & Python | Medium | Others |
857 | Minimum Cost to Hire K Workers | Java & Python | Hard | Others |
858 | Mirror Reflection | Java & Python | Medium | Others |
859 | Buddy Strings | Java & Python | Easy | Others |
860 | Lemonade Change | Java & Python | Easy | Others |
861 | Score After Flipping Matrix | Java & Python | Medium | Others |
862 | Shortest Subarray with Sum at Least K | Java & Python | Hard | Others |
863 | All Nodes Distance K in Binary Tree | Java & Python | Medium | Others |
864 | Shortest Path to Get All Keys | Java & Python | Hard | Others |
865 | Smallest Subtree with all the Deepest Nodes | Java & Python | Medium | Others |
866 | Prime Palindrome | Java & Python | Medium | Others |
867 | Transpose Matrix | Java & Python | Easy | Others |
868 | Binary Gap | Java & Python | Easy | Others |
869 | Reordered Power of 2 | Java & Python | Medium | Others |
870 | Advantage Shuffle | Java & Python | Medium | Others |
871 | Minimum Number of Refueling Stops | Java & Python | Hard | Others |
872 | Leaf-Similar Trees | Java & Python | Easy | Others |
873 | Length of Longest Fibonacci Subsequence | Java & Python | Medium | Others |
874 | Walking Robot Simulation | Java & Python | Easy | Others |
875 | Koko Eating Bananas | Java & Python | Medium | Others |
876 | Middle of the Linked List | Java & Python | Easy | Others |
877 | Stone Game | Java & Python | Medium | Others |
878 | Nth Magical Number | Java & Python | Hard | Others |
879 | Profitable Schemes | Java & Python | Hard | Others |
880 | Decoded String at Index | Java & Python | Medium | Others |
881 | Boats to Save People | Java & Python | Medium | Others |
882 | Reachable Nodes In Subdivided Graph | Java & Python | Hard | Others |
883 | Projection Area of 3D Shapes | Java & Python | Easy | Others |
884 | Uncommon Words from Two Sentences | Java & Python | Easy | Others |
885 | Spiral Matrix III | Java & Python | Medium | Others |
886 | Possible Bipartition | Java & Python | Medium | Others |
887 | Super Egg Drop | Java & Python | Hard | Others |
888 | Fair Candy Swap | Java & Python | Easy | Others |
889 | Construct Binary Tree from Preorder and Postorder Traversal | Java & Python | Medium | Others |
890 | Find and Replace Pattern | Java & Python | Medium | Others |
891 | Sum of Subsequence Widths | Java & Python | Hard | Others |
892 | Surface Area of 3D Shapes | Java & Python | Easy | Others |
893 | Groups of Special-Equivalent Strings | Java & Python | Easy | Others |
894 | All Possible Full Binary Trees | Java & Python | Medium | Others |
895 | Maximum Frequency Stack | Java & Python | Hard | Others |
896 | Monotonic Array | Java & Python | Easy | Others |
897 | Increasing Order Search Tree | Java & Python | Easy | Others |
898 | Bitwise ORs of Subarrays | Java & Python | Medium | Others |
899 | Orderly Queue | Java & Python | Hard | Others |
900 | RLE Iterator | Java & Python | Medium | Others |
901 | Online Stock Span | Java & Python | Medium | Others |
902 | Numbers At Most N Given Digit Set | Java & Python | Hard | Others |
903 | Valid Permutations for DI Sequence | Java & Python | Hard | Others |
904 | Fruit Into Baskets | Java & Python | Medium | Others |
905 | Sort Array By Parity | Java & Python | Easy | Others |
906 | Super Palindromes | Java & Python | Hard | Others |
907 | Sum of Subarray Minimums | Java & Python | Medium | Others |
908 | Smallest Range I | Java & Python | Easy | Others |
909 | Snakes and Ladders | Java & Python | Medium | Others |
910 | Smallest Range II | Java & Python | Medium | Others |
911 | Online Election | Java & Python | Medium | Others |
913 | Cat and Mouse | Java & Python | Hard | Others |
914 | X of a Kind in a Deck of Cards | Java & Python | Easy | Others |
915 | Partition Array into Disjoint Intervals | Java & Python | Medium | Others |
# | Title | Solutions | Difficulty | Tag |
---|---|---|---|---|
192 | Word Frequency | bash | Medium | Shell |
193 | Valid Phone Numbers | bash | Easy | Shell |
194 | Transpose File | bash | Medium | Shell |
195 | Tenth Line | bash | Easy | Shell |
# | Title | Solutions | Difficulty | Tag |
---|---|---|---|---|
175 | Combine Two Tables | MySQL | Easy | Database |
176 | Second Highest Salary | MySQL | Easy | Database |
177 | Nth Highest Salary | MySQL | Medium | Database |
178 | Rank Scores | MySQL | Medium | Database |
180 | Consecutive Numbers | MySQL | Medium | Database |
181 | Employees Earning More Than Their Managers | MySQL | Easy | Database |
182 | Duplicate Emails | MySQL | Easy | Database |
183 | Customers Who Never Order | MySQL | Easy | Database |
184 | Department Highest Salary | MySQL | Medium | Database |
185 | Department Top Three Salaries | MySQL | Hard | Database |
196 | Delete Duplicate Emails | MySQL | Easy | Database |
197 | Rising Temperature | MySQL | Easy | Database |
262 | Trips and Users | MySQL | Hard | Database |
595 | Big Countries | MySQL | Easy | Database |
596 | Classes More Than 5 Students | MySQL | Easy | Database |
601 | Human Traffic of Stadium | MySQL | Hard | Database |
620 | Not Boring Movies | MySQL | Easy | Database |
626 | Exchange Seats | MySQL | Medium | Database |
627 | Swap Salary | MySQL | Easy | Database |
# | Title | Solutions | Difficulty | Tag |
---|---|---|---|---|
Sort 1 | Bubble Sort | Java & Python | Easy | Sort Algorithm |
Sort 2 | Insert Sort | Java & Python | Easy | Sort Algorithm |
Sort 3 | Select Sort | Java & Python | Easy | Sort Algorithm |
Sort 4 | Quick Sort | Java & Python | Easy | Sort Algorithm |
Sort 5 | Merge Sort | Java & Python | Medium | Sort Algorithm |
Sort 6 | Heap Sort | Java & Python | Medium | Sort Algorithm |
Sort 7 | Bucket Sort | Java & Python | Easy | Sort Algorithm |
# | Title | Solutions | Difficulty | Tag |
---|---|---|---|---|
Search 1 | Binary Search | Java & Python | Easy | Search Algorithm |
Search 2 | Interpolation Search | Java & Python | Easy | Search Algorithmx |
Search 3 | Order Search | Java & Python | Easy | Search Algorithm |
# | Title | Solutions | Difficulty | Tag |
---|---|---|---|---|
1 | Two Sum | Java & Go | Easy | Array |
7 | Reverse Integer | Java & Go | Easy | Strings |
8 | String to Integer (atoi) | Java & Python | Medium | Strings |
13 | Roman to Integer | Java & Python | Easy | Math |
14 | Longest Common Prefix | Java & Go | Easy | Strings |
19 | Remove Nth Node From End of List | Java & Go | Medium | Linked List |
20 | Valid Parentheses | Java & Python | Easy | Others |
21 | Merge Two Sorted Lists | Java & Go | Easy | Linked List |
26 | Remove Duplicates from Sorted Array | Java & Go | Easy | Array |
28 | Implement strStr() | Java & Python | Easy | Strings |
36 | Valid Sudoku | Java & Python | Medium | Array |
38 | Count and Say | Java & Python | Easy | Strings |
48 | Rotate Image | Java & Go | Medium | Array |
53 | Maximum Subarray | Java & Python | Easy | Dynamic Programming |
66 | Plus One | Java & Go | Easy | Array |
70 | Climbing Stairs | Java & Python | Easy | Dynamic Programming |
88 | Merge Sorted Array | Java & Go | Easy | Sorting and Searching |
98 | Validate Binary Search Tree | Java & Go | Medium | Trees |
101 | Symmetric Tree | Java & Go | Easy | Trees |
102 | Binary Tree Level Order Traversal | Java & Python | Medium | Trees |
104 | Maximum Depth of Binary Tree | Java & Python | Easy | Trees |
108 | Convert Sorted Array to Binary Search Tree | Java & Python | Easy | Trees |
118 | Pascal's Triangle | Java & Go | Easy | Others |
121 | Best Time to Buy and Sell Stock | Java & Go | Easy | Dynamic Programming |
122 | Best Time to Buy and Sell Stock II | Java & Go | Easy | Array |
125 | Valid Palindrome | Java & Go | Easy | Strings |
136 | Single Number | Java & Go | Easy | Array |
141 | Linked List Cycle | Java & Go | Easy | Linked List |
155 | Min Stack | Java & Python | Easy | Design |
189 | Rotate Array | Java & Go | Easy | Array |
190 | Reverse Bits | Java & Python | Easy | Others |
191 | Number of 1 Bits | Java & Go | Easy | Others |
198 | House Robber | Java & Python | Easy | Dynamic Programming |
204 | Count Primes | Java & Go | Easy | Math |
206 | Reverse Linked List | Java & Go | Easy | Linked List |
217 | Contains Duplicate | Java & Go | Easy | Array |
234 | Palindrome Linked List | Java & Go | Easy | Linked List |
237 | Delete Node in a Linked List | Java & Go | Easy | Linked List |
242 | Valid Anagram | Java & Python | Easy | Strings |
268 | Missing Number | Java & Go | Easy | Others |
278 | First Bad Version | Java & Python | Easy | Sorting and Searching |
283 | Move Zeroes | Java & Go | Easy | Array |
326 | Power of Three | Java & Go | Easy | Math |
344 | Reverse String | Java & Go | Easy | Strings |
350 | Intersection of Two Arrays II | Java & Python | Easy | Array |
384 | Shuffle an Array | Java & Python | Medium | Design |
387 | First Unique Character in a String | Java & Python | Easy | Strings |
412 | Fizz Buzz | Java & Python | Easy | Math |
461 | Hamming Distance | Java & Go | Easy | Others |
# | Title | Solutions | Difficulty | Tag |
---|---|---|---|---|
2 | Add Two Numbers | Java & Python | Medium | Linked List |
3 | Longest Substring Without Repeating Characters | Java & Python | Medium | Array and Strings |
5 | Longest Palindromic Substring | Java & Python | Medium | Array and Strings |
15 | 3Sum | Java & Python | Medium | Array and Strings |
17 | Letter Combinations of a Phone Number | Java & Python | Medium | Backtracking |
22 | Generate Parentheses | Java & Python | Medium | Backtracking |
29 | Divide Two Integers | Java & Python | Medium | Math |
33 | Search in Rotated Sorted Array | Java & Python | Medium | Sorting and Searching |
34 | Find First and Last Position of Element in Sorted Array | Java & Python | Medium | Sorting and Searching |
46 | Permutations | Java & Python | Medium | Backtracking |
49 | Group Anagrams | Java & Python | Medium | Array and Strings |
50 | Pow(x, n) | Java & Python | Medium | Math |
55 | Jump Game | Java & Python | Medium | Dynamic Programming |
56 | Merge Intervals | Java & Python | Medium | Sorting and Searching |
62 | Unique Paths | Java & Python | Medium | Dynamic Programming |
69 | Sqrt(x) | Java & Python | Easy | Math |
73 | Set Matrix Zeroes | Java & Python | Medium | Array and Strings |
75 | Sort Colors | Java & Python | Medium | Sorting and Searching |
78 | Subsets | Java & Python | Medium | Backtracking |
79 | Word Search | Java & Python | Medium | Backtracking |
94 | Binary Tree Inorder Traversal | Java & Python | Medium | Trees and Graphs |
103 | Binary Tree Zigzag Level Order Traversal | Java & Python | Medium | Trees and Graphs |
105 | Construct Binary Tree from Preorder and Inorder Traversal | Java & Python | Medium | Trees and Graphs |
116 | Populating Next Right Pointers in Each Node | Java & Python | Medium | Trees and Graphs |
150 | Evaluate Reverse Polish Notation | Java & Python | Medium | Others |
160 | Intersection of Two Linked Lists | Java & Python | Easy | Linked List |
162 | Find Peak Element | Java & Python | Medium | Sorting and Searching |
166 | Fraction to Recurring Decimal | Java & Python | Medium | Math |
169 | Majority Element | Java & Python | Easy | Others |
171 | Excel Sheet Column Number | Java & Python | Easy | Math |
172 | Factorial Trailing Zeroes | Java & Python | Easy | Math |
200 | Number of Islands | Java & Python | Medium | Trees and Graphs |
202 | Happy Number | Java & Python | Easy | Math |
215 | Kth Largest Element in an Array | Java & Python | Medium | Sorting and Searching |
230 | Kth Smallest Element in a BST | Java & Python | Medium | Trees and Graphs |
240 | Search a 2D Matrix II | Java & Python | Medium | Sorting and Searching |
297 | Serialize and Deserialize Binary Tree | Java & Python | Medium | Design |
300 | Longest Increasing Subsequence | Java & Python | Medium | Dynamic Programming |
322 | Coin Change | Java & Python | Medium | Dynamic Programming |
328 | Odd Even Linked List | Java & Python | Medium | Linked List |
334 | Increasing Triplet Subsequence | Java & Python | Medium | Array and Strings |
347 | Top K Frequent Elements | Java & Python | Medium | Sorting and Searching |
371 | Sum of Two Integers | Java & Python | Easy | Others |
380 | Insert Delete GetRandom O(1) | Java & Python | Medium | Design |
621 | Task Scheduler | Java & Python | Medium | Others |
# | Title | Solutions | Difficulty | Tag |
---|---|---|---|---|
4 | Median of Two Sorted Arrays | Java & Python | Hard | Sorting and Searching |
10 | Regular Expression Matching | Java & Python | Hard | Backtracking |
11 | Container With Most Water | Java & Python | Medium | Array and Strings |
23 | Merge k Sorted Lists | Java & Python | Hard | Linked List |
41 | First Missing Positive | Java & Python | Hard | Array and Strings |
42 | Trapping Rain Water | Java & Python | Hard | Others |
44 | Wildcard Matching | Java & Python | Hard | Backtracking |
54 | Spiral Matrix | Java & Python | Medium | Array and Strings |
76 | Minimum Window Substring | Java & Python | Hard | Array and Strings |
84 | Largest Rectangle in Histogram | Java & Python | Hard | Others |
91 | Decode Ways | Java & Python | Medium | Dynamic Programming |
124 | Binary Tree Maximum Path Sum | Java & Python | Hard | Trees and Graphs |
127 | Word Ladder | Java & Python | Medium | Trees and Graphs |
128 | Longest Consecutive Sequence | Java & Python | Hard | Array and Strings |
130 | Surrounded Regions | Java & Python | Medium | Trees and Graphs |
131 | Palindrome Partitioning | Java & Python | Medium | Backtracking |
135 | Copy List with Random Pointer | Java & Python | Medium | Linked List |
139 | Word Break | Java & Python | Medium | Dynamic Programming |
140 | Word Break II | Java & Python | Hard | Dynamic Programming |
146 | LRU Cache | Java & Python | Medium | Design |
148 | Sort List | Java & Python | Medium | Linked List |
149 | Max Points on a Line | Java & Python | Hard | Math |
152 | Maximum Product Subarray | Java & Python | Medium | Dynamic Programming |
179 | Largest Number | Java & Python | Medium | Math |
207 | Course Schedule | Java & Python | Medium | Trees and Graphs |
208 | Implement Trie (Prefix Tree) | Java & Python | Medium | Design |
210 | Course Schedule II | Java & Python | Medium | Trees and Graphs |
212 | Word Search II | Java & Python | Hard | Backtracing |
218 | The Skyline Problem | Java & Python | Hard | Others |
227 | Basic Calculator II | Java & Python | Medium | Array and Strings |
236 | Lowest Common Ancestor of a Binary Tree | Java & Python | Medium | Trees and Graphs |
238 | Product of Array Except Self | Java & Python | Medium | Array and Strings |
239 | Sliding Window Maximum | Java & Python | Hard | Array and Strings |
279 | Perfect Squares | Java & Python | Medium | Dynamic Programming |
287 | Find the Duplicate Number | Java & Python | Medium | Array and Strings |
289 | Game of Life | Java & Python | Medium | Array and Strings |
295 | Find Median from Data Stream | Java & Python | Hard | Design |
301 | Remove Invalid Parentheses | Java & Python | Hard | Backtracking |
309 | Best Time to Buy and Sell Stock with Cooldown | Java & Python | Medium | Dynamic Programming |
312 | Burst Balloons | Java & Python | Hard | Dynamic Programming |
315 | Count of Smaller Numbers After Self | Java & Python | Hard | Trees and Graphs |
324 | Wiggle Sort II | Java & Python | Medium | Sorting and Searching |
329 | Longest Increasing Path in a Matrix | Java & Python | Hard | Trees and Graphs |
341 | Flatten Nested List Iterator | Java & Python | Medium | Design |
378 | Kth Smallest Element in a Sorted Matrix | Java & Python | Medium | Sorting and Searching |
406 | Queue Reconstruction by Height | Java & Python | Medium | Others |
454 | 4Sum II | Java & Python | Medium | Array and Strings |
547 | Friend Circles | Java & Python | Medium | Trees and Graphs |