LeetCode
![Progress](https://camo.githubusercontent.com/d4bb87dae5b37babffa273f5737adeac99975c65eae3b5092cb34d35d3bd35b5/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f70726f67726573732d3337312532302532462532303731392d6666363962342e737667)
(2017-06-22) This repository contains my working solutions to the problems found on LeetCode.
Algorithms
- Arrays
- Bit Tricks
- Design Patterns
- Dynamic Programing
- Linked Lists
- Trees and Graphs
- Search
- Stack
- Strings
- Heap
- Hash Tables
Arrays
# | Title | Solution | Time | Space | Difficulty | Notes |
---|---|---|---|---|---|---|
66 | Plus one | C++ / Java | O(n) | O(1) | Easy | |
349 | Valid Perfect Square | C++ | O(n) | O(n) | Easy | |
350 | Valid Perfect Square II | C++ | O(n) | O(n) | Easy |
Bit Tricks
# | Title | Solution | Time | Space | Difficulty | Notes |
---|---|---|---|---|---|---|
371 | Sum of Two Integers | C++ | O(log n) | O(1) | Easy |
Design Patterns
# | Title | Solution | Time | Space | Difficulty | Notes |
---|---|---|---|---|---|---|
341 | Flatten Nested List Iterator | C++ | O(1) / O(n) | O(n) | Medium |
Dynamic Programing
# | Title | Solution | Time | Space | Difficulty | Notes |
---|---|---|---|---|---|---|
375 | Guess Number Higher or Lower II | C++ | O(n^3) | O(n^2) | Medium |
Math
# | Title | Solution | Time | Space | Difficulty | Notes |
---|---|---|---|---|---|---|
342 | Power of Four | C++ | O(log n) | O(1) | Easy | |
343 | Integer Break | Java | O(log n ) | O(1) | Medium | |
367 | Valid Perfect Square | C++ | O( sqrt(n) ) | O(1) | Medium |
Search
# | Title | Solution | Time | Space | Difficulty | Notes |
---|---|---|---|---|---|---|
347 | Top K Frequent Elements | C++ | O(n) | O(n) | Medium | |
373 | Find K Pairs with Smallest Sums | C++ | O(k log k) | O(k) | Medium | |
374 | Guess Number Higher or Lower | C++ | O(log n) | O(1) | Easy |
Strings
# | Title | Solution | Time | Space | Difficulty | Notes |
---|---|---|---|---|---|---|
344 | Reverse String | Java | O( n ) | O(n) | Easy | |
345 | Reverse Vowels of a String | C++ | O( n ) | O(n) | Easy |
Trees and Graphs
# | Title | Solution | Time | Space | Difficulty | Notes |
---|---|---|---|---|---|---|
133 | Clone Graph | C++ | O(V+E) | O(V) | Medium | BFS |