Skip to content

Instantly share code, notes, and snippets.

@ehsan18t
Created September 16, 2025 16:08
Show Gist options
  • Save ehsan18t/281953e4f69b6c955d2fc82f25676092 to your computer and use it in GitHub Desktop.
Save ehsan18t/281953e4f69b6c955d2fc82f25676092 to your computer and use it in GitHub Desktop.
This is a list of programming problems from various sites (like LeetCode, Codeforces) and designed in way to take you from zero. All you need to do is follow the serial and solve problems.

The Grand Plan: 225 Problems from Zero to Hero

This list is designed to be followed serially, from #1 to #225. It starts with the absolute basics and gradually introduces new data structures, algorithms, and more complex variations of old ones. Early problems build the foundation for later problems.

Instructions:

  • DO NOT jump around. The order is crucial.
  • Struggle is part of the process. If a problem feels hard, it's because it's likely introducing a new idea. Spend time trying to solve it before looking at solutions.
  • Master the pattern. After solving a problem, ask yourself: What was the key idea? Is this a two-pointer problem? A binary search? A specific greedy choice?
  • Spaced Repetition. Occasionally, go back and re-solve a random problem from 20-30 spots earlier in the list to ensure the concepts stick.

Phase 1: The Foundation (Problems 1-50)

(Focus: Basic Array/String manipulation, Hashing, Two Pointers)

  1. Two Sum (Easy)
  2. Contains Duplicate (Easy)
  3. Valid Anagram (Easy)
  4. Best Time to Buy and Sell Stock (Easy)
  5. Valid Palindrome (Easy)
  6. Merge Sorted Array (Easy)
  7. Length of Last Word (Easy)
  8. Remove Duplicates from Sorted Array (Easy)
  9. Remove Element (Easy)
  10. Find the Index of the First Occurrence in a String (Easy)
  11. Maximum Subarray (Medium)
  12. Majority Element (Easy)
  13. Move Zeroes (Easy)
  14. Missing Number (Easy)
  15. Fizz Buzz (Easy)
  16. Single Number (Easy)
  17. Pascal's Triangle (Easy)
  18. Ransom Note (Easy)
  19. Squares of a Sorted Array (Easy)
  20. Group Anagrams (Medium)
  21. Two Sum II - Input Array Is Sorted (Medium)
  22. Product of Array Except Self (Medium)
  23. Top K Frequent Elements (Medium)
  24. Sort Colors (Medium)
  25. 3Sum (Medium)
  26. Container With Most Water (Medium)
  27. Find All Numbers Disappeared in an Array (Easy)
  28. Happy Number (Easy)
  29. Verifying an Alien Dictionary (Easy)
  30. Longest Common Prefix (Easy)
  31. Backspace String Compare (Easy)
  32. Is Subsequence (Easy)
  33. Longest Palindrome (Easy)
  34. Find Pivot Index (Easy)
  35. First Unique Character in a String (Easy)
  36. Unique Email Addresses (Easy)
  37. Isomorphic Strings (Easy)
  38. Word Pattern (Easy)
  39. Summary Ranges (Easy)
  40. Range Sum Query - Immutable (Easy)
  41. Maximum Product of Three Numbers (Easy)
  42. Minimum Moves to Equal Array Elements (Medium)
  43. Rotate Array (Medium)
  44. Encode and Decode Strings (Medium) (LeetCode Premium / Available on NeetCode)
  45. Spiral Matrix (Medium)
  46. Set Matrix Zeroes (Medium)
  47. Rotate Image (Medium)
  48. Minimum Moves to Equal Array Elements II (Medium)
  49. Subarray Sum Equals K (Medium)
  50. Find the Duplicate Number (Medium)

Phase 2: Core Data Structures & Algorithms (Problems 51-125)

(Focus: Stacks, Linked Lists, Binary Search, Sliding Window, Basic Trees)

  1. Valid Parentheses (Easy)
  2. Min Stack (Medium)
  3. Evaluate Reverse Polish Notation (Medium)
  4. Generate Parentheses (Medium)
  5. Daily Temperatures (Medium)
  6. Car Fleet (Medium)
  7. Largest Rectangle in Histogram (Hard)
  8. Reverse Linked List (Easy)
  9. Merge Two Sorted Lists (Easy)
  10. Linked List Cycle (Easy)
  11. Palindrome Linked List (Easy)
  12. Remove Nth Node From End of List (Medium)
  13. Reorder List (Medium)
  14. Add Two Numbers (Medium)
  15. LRU Cache (Medium)
  16. Copy List with Random Pointer (Medium)
  17. Merge k Sorted Lists (Hard)
  18. Reverse Nodes in k-Group (Hard)
  19. Binary Search (Easy)
  20. Search a 2D Matrix (Medium)
  21. Find Minimum in Rotated Sorted Array (Medium)
  22. Search in Rotated Sorted Array (Medium)
  23. Time Based Key-Value Store (Medium)
  24. Koko Eating Bananas (Medium)
  25. Median of Two Sorted Arrays (Hard)
  26. Longest Substring Without Repeating Characters (Medium)
  27. Longest Repeating Character Replacement (Medium)
  28. Permutation in String (Medium)
  29. Minimum Window Substring (Hard)
  30. Sliding Window Maximum (Hard)
  31. Invert Binary Tree (Easy)
  32. Maximum Depth of Binary Tree (Easy)
  33. Diameter of Binary Tree (Easy)
  34. Same Tree (Easy)
  35. Subtree of Another Tree (Easy)
  36. Balanced Binary Tree (Easy)
  37. Lowest Common Ancestor of a Binary Search Tree (Easy)
  38. Binary Tree Level Order Traversal (Medium)
  39. Binary Tree Right Side View (Medium)
  40. Count Good Nodes in Binary Tree (Medium)
  41. Validate Binary Search Tree (Medium)
  42. Kth Smallest Element in a BST (Medium)
  43. Construct Binary Tree from Preorder and Inorder Traversal (Medium)
  44. Lowest Common Ancestor of a Binary Tree (Medium)
  45. Binary Tree Maximum Path Sum (Hard)
  46. Serialize and Deserialize Binary Tree (Hard)
  47. Implement Trie (Prefix Tree) (Medium)
  48. Design Add and Search Words Data Structure (Medium)
  49. Word Search (Medium)
  50. Word Search II (Hard)
  51. Kth Largest Element in a Stream (Easy)
  52. Last Stone Weight (Easy)
  53. K Closest Points to Origin (Medium)
  54. Kth Largest Element in an Array (Medium)
  55. Task Scheduler (Medium)
  56. Design Twitter (Medium)
  57. Find Median from Data Stream (Hard)
  58. Subsets (Medium)
  59. Combination Sum (Medium)
  60. Permutations (Medium)
  61. Subsets II (Medium)
  62. Combination Sum II (Medium)
  63. Permutations II (Medium)
  64. Letter Combinations of a Phone Number (Medium)
  65. Palindrome Partitioning (Medium)
  66. N-Queens (Hard)
  67. Number of Islands (Medium)
  68. Max Area of Island (Medium)
  69. Clone Graph (Medium)
  70. Pacific Atlantic Water Flow (Medium)
  71. Surrounded Regions (Medium)
  72. Rotting Oranges (Medium)
  73. Walls and Gates (Medium) (LeetCode Premium / Available on NeetCode)
  74. Course Schedule (Medium)
  75. Course Schedule II (Medium)

Phase 3: Dynamic Programming & Advanced Algorithms (Problems 126-225)

(Focus: Greedy, DP, Advanced Graph, Math/Misc)

  1. Climbing Stairs (Easy)
  2. Min Cost Climbing Stairs (Easy)
  3. House Robber (Medium)
  4. House Robber II (Medium)
  5. Longest Palindromic Substring (Medium)
  6. Palindromic Substrings (Medium)
  7. Decode Ways (Medium)
  8. Coin Change (Medium)
  9. Maximum Product Subarray (Medium)
  10. Word Break (Medium)
  11. Longest Increasing Subsequence (Medium)
  12. Partition Equal Subset Sum (Medium)
  13. Unique Paths (Medium)
  14. Jump Game (Medium)
  15. Gas Station (Medium)
  16. Merge Intervals (Medium)
  17. Non-overlapping Intervals (Medium)
  18. Insert Interval (Medium)
  19. Meeting Rooms (Easy) (LeetCode Premium / Available on NeetCode)
  20. Meeting Rooms II (Medium) (LeetCode Premium / Available on NeetCode)
  21. Graph Valid Tree (Medium) (LeetCode Premium / Available on NeetCode)
  22. Number of Connected Components in an Undirected Graph (Medium) (LeetCode Premium / Available on NeetCode)
  23. Redundant Connection (Medium)
  24. Word Ladder (Hard)
  25. Network Delay Time (Medium)
  26. Cheapest Flights Within K Stops (Medium)
  27. Reverse Bits (Easy)
  28. Number of 1 Bits (Easy)
  29. Counting Bits (Easy)
  30. Sum of Two Integers (Medium)
  31. Combination Sum IV (Medium)
  32. House Robber III (Medium)
  33. Target Sum (Medium)
  34. Interleaving String (Medium)
  35. Longest Common Subsequence (Medium)
  36. Edit Distance (Medium)
  37. Best Time to Buy and Sell Stock with Cooldown (Medium)
  38. Best Time to Buy and Sell Stock with Transaction Fee (Medium)
  39. Coin Change II (Medium)
  40. Burst Balloons (Hard)
  41. Distinct Subsequences (Hard)
  42. Regular Expression Matching (Hard)
  43. Wildcard Matching (Hard)
  44. Partition to K Equal Sum Subsets (Medium)
  45. Find All Anagrams in a String (Medium)
  46. Minimum Height Trees (Medium)
  47. Reconstruct Itinerary (Hard)
  48. Accounts Merge (Medium)
  49. Longest Consecutive Sequence (Medium)
  50. Alien Dictionary (Hard) (LeetCode Premium / Available on NeetCode)
  51. Hand of Straights (Medium)
  52. Binary Tree Zigzag Level Order Traversal (Medium)
  53. Next Permutation (Medium)
  54. Trapping Rain Water (Hard)
  55. Basic Calculator (Hard)
  56. Text Justification (Hard)
  57. Integer to English Words (Hard)
  58. Minimum Knight Moves (Medium)
  59. Jump Game II (Medium)
  60. Find the Celebrity (Medium) (LeetCode Premium)
  61. Pow(x, n) (Medium)
  62. Sqrt(x) (Easy)
  63. Search Suggestions System (Medium)
  64. Candy (Hard)
  65. Swim in Rising Water (Hard)
  66. Path with Maximum Probability (Medium)
  67. Connecting Cities With Minimum Cost (Medium) (LeetCode Premium)
  68. Min Cost to Connect All Points (Medium)
  69. Design In-Memory File System (Hard)
  70. All O`one Data Structure (Hard)
  71. Find First and Last Position of Element in Sorted Array (Medium)
  72. Count of Smaller Numbers After Self (Hard)
  73. Longest Increasing Path in a Matrix (Hard)
  74. Range Sum Query 2D - Immutable (Medium)
  75. Maximum Frequency Stack (Hard)
  76. Word Break II (Hard)
  77. Palindrome Pairs (Hard)
  78. Russian Doll Envelopes (Hard)
  79. The Skyline Problem (Hard)
  80. Shortest Path in a Grid with Obstacles Elimination (Hard)
  81. Sudoku Solver (Hard)
  82. Split Array Largest Sum (Hard)
  83. LFU Cache (Hard)
  84. Maximum Gap (Medium)
  85. Count Vowels Permutation (Hard)
  86. Number of Ways to Form a Target String Given a Dictionary (Hard)
  87. Maximum Number of Events That Can Be Attended (Medium)
  88. Shortest Path Visiting All Nodes (Hard)
  89. Number of Good Paths (Hard)
  90. Frog Jump (Hard)
  91. Max Points on a Line (Hard)
  92. Freedom Trail (Hard)
  93. Stone Game IV (Hard)
  94. Race Car (Hard)
  95. Remove Invalid Parentheses (Hard)
  96. Integer to Roman (Medium)
  97. Roman to Integer (Easy)
  98. Simplify Path (Medium)
  99. Champagne Tower (Medium)
  100. Check If a String Is a Valid Sequence from Root to Leaves Path in a Binary Tree (Medium) (LeetCode Premium)

This list will give you a comprehensive tour of the most important patterns in programming interviews and competitive programming. Good luck, and enjoy the journey!

@shamsch
Copy link

shamsch commented Sep 16, 2025

ok thanks a lot bro, love and support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment