My submissions for LeetCode Oj.
- Array
- Linked List
- Depth First Search
- Breadth First Search
- Two Pointers
- Sliding Window
- Bit
- Stack
- HashMap
- Heap
- Random
- DP
- Design
- Binary Search
- Math
- String
- Tree
- Graph
Title | Solution | Difficulty |
---|---|---|
342. Power Of Four | Use loop, Bit Manipulation | Easy |
136. Single Number | xor | Easy |
Title | Solution | Difficulty |
---|---|---|
719. Find K-th Smallest Pair Distance | Binary Search+Sliding Window | Hard |
Title | Solution | Difficulty |
---|---|---|
636. Exclusive Time of Functions | Use stack to track function id | Medium |
394. Decode String | use two stacks | Medium |
901. Online Stock Span | use stack | Medium |
Title | Solution | Difficulty |
---|---|---|
1048. Longest String Chain | hashmap + DFS + Memorization | Medium |
36. Valid Sudoku | use hashmaps | Medium |
380. Insert Delete GetRandom O(1) | hashmap and array | Medium |
381. Insert Delete GetRandom O(1) - Duplicates allowed | use hashmap and unordered_set | Hard |
525. Contiguous Array | use hashmap | Medium |
560. Subarray Sum Equals K | use hashmap | Medium |
Title | Solution | Difficulty |
---|---|---|
200. Number OfIslands | use BFS | Medium |
Title | Solution | Difficulty |
---|---|---|
973. K Closest Points to Origin | use max-k-heap, use quick select | Medium |
Title | Solution | Difficulty |
---|---|---|
528. Random Pick with Weight | use rand.Intn and binary search | Medium |
Title | Solution | Difficulty |
---|---|---|
146. LRU Cache | use doubly linked list with hashmap | Medium |
Title | Solution | Difficulty |
---|---|---|
1462. Course Schedule IV | use floyd wrashall | Medium |