This repository provides explanations of optimal algorithms for major LeetCode problems. Each solution includes a step-by-step thought process and alternative approaches where applicable.
- 141. Linked List Cycle
- 142. Linked List Cycle II
- 83. Remove Duplicates from Sorted List
- 82. Remove Duplicates from Sorted List II
- 2. Add Two Numbers
- 703. Kth Largest Element in a Stream
- 347. Top K Frequent Elements
- 373. Find K Pairs with Smallest Sums
- 1. Two Sum
- 49. Group Anagrams
- 349. Intersection of Two Arrays
- 929. Unique Email Addresses
- 387. First Unique Character in a String
- 560. Subarray Sum Equals K
- 200. Number of Islands
- 695. Max Area of Island
- 323. Number of Connected Components in an Undirected Graph
- 127. Word Ladder
- 104. Maximum Depth of Binary Tree
- 111. Minimum Depth of Binary Tree
- 617. Merge Two Binary Trees
- 108. Convert Sorted Array to Binary Search Tree
- 112. Path Sum
- 102. Binary Tree Level Order Traversal
- 103. Binary Tree Zigzag Level Order Traversal
- 98. Validate Binary Search Tree
- 105. Construct Binary Tree from Preorder and Inorder Traversal
- 276. Paint Fence
- 300. Longest Increasing Subsequence
- 53. Maximum Subarray
- 62. Unique Paths
- 63. Unique Paths II
- 198. House Robber
- 213. House Robber II
- 121. Best Time to Buy and Sell Stock
- 122. Best Time to Buy and Sell Stock II
- 139. Word Break
- 322. Coin Change