Begniner Coding Problems
I tried to cover as much as I could, but I skipped Binary Tree in intermediate because I thought the other algorithms were more important. These are interview problems, so they should be quite challenging. Solutions
Beginner
- Index of Character in String Without indexOf (Linear Search)
- Sum of 2D Array (Basic Traversal of 2D Array)
- N Factorial (Basic Index Manipulation)
- FizzBuzz [412] (Stacked If-Statements)
- Index of Substring in String Without indexOf [28] (Linear Search, Index Manipulation)
- Two Numbers in Array That Add to Target [1] (Special Traversal of 2D Array)
- Nth Term of Fibonacci Sequence [509] (Recursion/Repitition)
- Binary Search [704] (Basic Sorted Array Manipulation)
- Sort Array of 0s, 1s, and 2s In-Place [75] (Simple Counting Sort)
- Most Occuring Number in Array, aka Mode (Map)
- Minimum Cost Climbing Stairs [746] (Dynamic Programming)
- Longest Common Prefix of String Array [14] (Jagged Array)
- Two Numbers in Array That Add to Target in O(n) [1] (HashMap/HashSet)
- Rotate 2D Array [48] (2D Array Index Manipulation)
- Sort Numbers From -50,000 to 50,000 [912] (MergeSort/RadixSort)
- Valid Parentheses [20] (Stack)
- Letter Combinations of a Phone Number [17] (Combinations)
- Group Anagrams [49] (HashMap, String)
- Container With Most Water [11] (Two Pointer, Greedy)
- Minimum Path Sum [64] (Dynamic Programming)
Advanced
- Find First and Last Position of Element in O(log n) [34] (Two Pointer, Binary Search)
- Merge Intervals [56] (Array)
- Merge k Sorted Lists [23] (LinkedList)
- Reverse Nodes in k-Group [25] (LinkedList)
- Combination Sum [39] (Combinations)
- First Missing Positive in O(n) Time and O(k) Extra Memory [41] (Memory Manipulation)
- Maximum Path Sum [124] (Binary Tree, Dynamic Programming)
- Longest Valid Parentheses [32] (Stack)
- Trapping Rain Water [42] (Two Pointer)
- Largest Rectangle in Histogram [84] (Monotonic Stack)