A collection of LeetCode solutions to practice various programming languages, mainly java python sometimes ruby kotlin
Follow each problem link to to see its description, solution and explanation. The solution may appear in multiple languages, just for fun.
| Array | Difficulty | Tag |
|---|---|---|
| Kids with the Greatest Number of Candies | LC75 | |
| Can Place Flowers | LC75 | |
| Merge Sorted Array | Top150 | |
| Majority Element | Top150 | |
| Remove Element | Top150 | |
| Remove Duplicates from Sorted Array I | Top150 | |
| Remove Duplicates from Sorted Array II | Top150 | |
| Product of Array Except Self | LC75 | |
| Increasing Triplet Subsequence | LC75 | |
| Candy | Top150 | |
| Trapping Rain Water | Top150 |
| String | Difficulty | Tag |
|---|---|---|
| Merge Strings Alternately | LC75 | |
| Greatest Common Divisor of Strings | LC75 | |
| Reverse Vowels of a String | LC75 | |
| Roman to Integer | Top150 | |
| Integer to Roman | Top150 | |
| Reverse Words in a String | LC75 | |
| String Compression | LC75 |
| Two Pointers | Difficulty | Tag |
|---|---|---|
| Move Zeroes | LC75 | |
| Is Subsequence | LC75 | |
| Container With Most Water | LC75 | |
| Max Number of K-sum Pairs | LC75 |
| Sliding Window | Difficulty | Tag |
|---|---|---|
| Maximum Average Subarray I | LC75 | |
| Maximum Number Of Vowels In A Substring Of Given Length | LC75 | |
| Max Consecutive Ones III | LC75 | |
| Longest Subarray of 1's After Deleting One Element | LC75 |
| Prefix Sum | Difficulty | Tag |
|---|---|---|
| Find the Highest Altitude | LC75 | |
| Find Pivot Index | LC75 |
| Hashmap / Set | Difficulty | Tag |
|---|---|---|
| Find the Difference of Two Arrays | LC75 | |
| Unique Number Of Occurrences | LC75 | |
| Determine If Two Strings Are Close | LC75 | |
| Equal Row and Column Pairs | LC75 |
| Stack | Difficulty | Tag |
|---|---|---|
| Removing Stars from a String | LC75 | |
| Asteroid Collision | LC75 | |
| Decode String | LC75 |
| Queue | Difficulty | Tag |
|---|---|---|
| Number of Recent Calls | LC75 | |
| Dota2 Senate | LC75 |
| Linked List | Difficulty | Tag |
|---|---|---|
| Reverse Linked List | LC75 | |
| Delete The middle Node of a Linked List | LC75 | |
| Odd Even Linked List | LC75 | |
| Maximum Twin Sum of a Linked List | LC75 |
| Depth-First Search (DFS) | Difficulty | Tag |
|---|---|---|
| Maximum Depth of Binary Tree | LC75 | |
| Leaf-similar Trees | LC75 | |
| Count Good Nodes in Binary Tree | LC75 | |
| Path Sum III | LC75 | |
| Longest ZigZag Path in a Binary Tree | LC75 | |
| Lowest Common Ancestor of a Binary Tree | LC75 |
| Breadth-First Search (BFS) | Difficulty | Tag |
|---|---|---|
| Binary Tree Right Side View | LC75 | |
| Maximum Level Sum of a Binary Tree | LC75 |
| Binary Search (BST) | Difficulty | Tag |
|---|---|---|
| Search in a Binary Search Tree | LC75 | |
| Delete Node in a BST | LC75 |
| Depth-First Search (DFS) | Difficulty | Tag |
|---|---|---|
| Keys and Rooms | LC75 | |
| Number of Provinces | LC75 | |
| Reorder Routes to Make All Paths Lead to the City Zero | LC75 | |
| Evaluate Division | LC75 | |
| Spreadsheet | Real Interview |
| Breadth-First Search (BFS) | Difficulty | Tag |
|---|---|---|
| Nearest Exit from Entrance in Maze | LC75 | |
| Rotting Oranges | LC75 | |
| Crawler | Real Interview |
| Heap / Priority Queue | Difficulty | Tag |
|---|---|---|
| Kth Largest Element in an Array | LC75 | |
| Smallest Number in Infinite Set | LC75 | |
| Maximum Subsequence Score | LC75 | |
| Total Cost to Hire K Workers | LC75 |
| Binary Search | Difficulty | Tag |
|---|---|---|
| Guess Number Higher or Lower | LC75 | |
| Successful Pairs of Spells or Potions | LC75 | |
| Find Peak Element | LC75 | |
| Koko Eating Bananas | LC75 |
| Backtracking | Difficulty | Tag |
|---|---|---|
| Letter Combinations of a Phone Number | LC75 | |
| Combination Sum III | LC75 |
| 1 Dimensional | Difficulty | Tag |
|---|---|---|
| Nth Tribonacci Number | LC75 | |
| Min Cost Climbing Stairs | LC75 | |
| House Robber | LC75 | |
| Domino and Tromino Tiling | LC75 |
| Multi Dimensional | Difficulty | Tag |
|---|---|---|
| Unique Paths | LC75 | |
| Longest Common Subsequence | LC75 | |
| Best Time to Buy and Sell Stock with Transaction Fee | LC75 | |
| Edit Distance | LC75 |
| Bit Manipulation | Difficulty | Tag |
|---|---|---|
| Counting Bits | LC75 | |
| Single Number | LC75 | |
| Minimum Flips to Make a OR b Equal to c | LC75 |
| Trie | Difficulty | Tag |
|---|---|---|
| Implement Trie (Prefix Tree) | LC75 | |
| Search Suggestions System | LC75 |
| Intervals | Difficulty | Tag |
|---|---|---|
| Non-overlapping Intervals | LC75 | |
| Minimum Number of Arrows to Burst Balloons | LC75 |
| Monotonic Stack | Difficulty | Tag |
|---|---|---|
| Daily Temperatures | LC75 | |
| Online Stock Span | LC75 |
| LeetCode Hard | Difficulty |
|---|---|
| Count of Numbers After Self | |
| Longest Consecutive Sequence | |
| Minimum Window Substring | |
| Skyline | |
| Sliding Window Maximum | |
| Sum Divisibles | |
| Wildcard Matching |
You will find these badges on top of each problem page:
* Asterisk indicates disputed difficulty.