These are my solutions to Leetcode problems in Java 8. I have tried to keep the solutions clear and concise, but there might be opportunities for improvement. In that case, just send me a PR.
| Problem ID | Problem | Solution | Space Complexity | Time Complexity | Runtime (ms) |
|---|---|---|---|---|---|
| 832 | Flipping an image | Click | O(m*n) | O(1) | 8 |
| 824 | Goat Latin | Click | O(n) | O(1) | 95 |
| 830 | Positions of Large Groups | Click | O(n) | O(1) | 19 |
| 821 | Shortest Distance to a Character | Click | O(n) | O(1) | 9 |
| 819 | Most Common Word | Click | O(n) | O(n) | 84 |
| 811 | Subdomain Visit Count | Click | O(n) | O(n) | 116 |
| 806 | Number of Lines to Write String | Click | O(n) | O(1) | 3 |
| 804 | Unique Morse Code Words | Click | O(n) | O(1) | 11 |
| 796 | Rotate String | Click | O(n) | O(1) | 4 |
| 788 | Rotated Digits | Click | O(2^N * N) | O(1) | 214 |
| 784 | Letter Case Permutation | Click | O(2 ^ n) | O(2 ^ n) for returning, else O(1) | 97 |
| 783 | Minimum Distance Between BST Nodes | Click | O(n) | O(1) | 5 |
| 771 | Jewels and stones | Click | O(n) | O(1) | 19 |
| 695 | Max Area of Island | Click | O(m * n) | O(m * n) | 37 |
| 203 | Remove linked list elements | Click | O(n) | O(1) | 7 |
| 122 | Best Time to Buy and Sell Stock II | Click | O(n) | O(1) | 2 |
| 121 | Best Time to Buy and Sell Stock | Click | O(n) | O(1) | 1 |
| 111 | Minimum Depth of Binary Tree | Click | O(n) | O(1) | 0 |
| 20 | Valid Parentheses | Click | O(n) | O(1) | 58 |
| Problem ID | Problem | Solution | Space Complexity | Time Complexity | Runtime (ms) |
|---|---|---|---|---|---|
| 765 | Couples Holding Hands | Click | O(n) | O(n) | 5 |
| 297 | Serialize and Deserialize Binary Tree | Click | O(n) | O(n) | 17 |
| 72 | Edit Distance | Click | O(m * n) | O(m * n) | 14 |
| 23 | Merge k Sorted Lists | Click | O(n) | O(1) | 14 |