| Next Permutation |
31 |
Single pass approach |
| LRU Cache |
146 |
Dqueue |
| Sort Characters By Frequency |
451 |
Single pass approach |
| Majority Element |
169 |
Single pass approach |
| Cousins in Binary Tree |
993 |
Depth First Search |
| Spiral Matrix |
54 |
Single pass approach |
| Binary Tree Inorder Traversal |
94 |
Iterating using Stack |
| Longest Increasing Path in a Matrix |
329 |
Topological Sort (matrix) |
| Flood Fill |
733 |
Depth First Search (matrix) |
| Find the town judge |
997 |
Single pass approach |
| Remove K Digits |
402 |
Stack approach |
| Search in Rotated Sorted Array |
33 |
Binary Search |
| Merge Sorted Array |
88 |
iterate in place merge |
| Implement Trie (Prefix Tree) |
208 |
Trie tree |
| Kth Smallest Element in a BST |
230 |
Iteration through stack |
| Online Stock Span |
901 |
Iteration using weighted stack |
| Permutation in a string |
567 |
Sliding window |
| Convert Sorted List to Binary Search Tree |
109 |
recursive in-order |
| Top K Frequent Elements |
347 |
Min Heap |
| Interval List Intersections |
986 |
merge intervals |
| Construct Binary Search Tree from Preorder Traversal |
1008 |
recursive |
| Find Largest Value in Each Tree Row |
515 |
Queue |
| Edit Distance |
72 |
Dynamic Programming |
| Longest Increasing Subsequence |
300 |
Dynamic Programming with Binary Search |
| Meetings rooms II |
253 |
Min Heap |
| Cheapest Flights Within K Stops |
787 |
BFS |
| Snapshot Array |
1146 |
Array with binary search |
| Serialize and Deserialize Binary Tree |
297 |
Queue |
| Design Circular Queue |
622 |
array |
| Fibonacci Number |
509 |
Iterative top down |
| monotonic-array |
896 |
Single pass |
| Trapping Rain Water |
42 |
Dynamic Programming |
| Reorganize String |
767 |
max Heap |
| Redundant Connection |
684 |
depth first search |
| Search a 2D Matrix II |
240 |
binary search |
| Search 2D Matrix |
74 |
binary search |
| Find Distance in a Binary Tree |
1740 |
DFS |
| Word Search II |
212 |
trie + backtracking |
| Word Search |
79 |
depth first search |
| Delete the Middle Node of a Linked List |
2095 |
fast & slow pointer |
| Count Substrings With K-Frequency Characters |
3325 |
Sliding Window |
| Palindromes - Semordnilap |
0 |
iteration |
| Remove Nth Node From End of list |
19 |
iteration |
| Linked List Cycle II |
142 |
iteration, fast and slow pointer |
| Reverse Prefix of Word |
2000 |
stack |
| Balanced Binary Tree |
110 |
recursive |
| Maximum Subarray |
53 |
Linear |
| Subarray with ZERO sum |
001 |
Linear |
| Smallest subarray with sum greater than x |
004 |
Linear |
| Best time to buy and sell stock |
188 |
Dynamic program |
| All Nodes Distance K in Binary Tree |
863 |
BFS |
| All Nodes Distance K from target Value |
863A |
BFS |
| Vertical Order Traversal of a Binary Tree |
987 |
BFS |
| Remove Duplicates from Sorted List II |
82 |
Linear |
| Remove Duplicates Sorted Array |
82A |
Linear |
| Next Greater Element |
002 |
Linear |
| Indexes of Subarray Sum |
003 |
Sliding Window |
| Implementing Stack Using Queue |
225 |
using 1 queue and 2 queue |
| Number of Closed Islands |
1254 |
BFS traversal |