If you're new to LeetCode, it's best to start with easy-to-medium problems that cover fundamental concepts like arrays, strings, and dynamic programming. Here’s a structured list to help you build confidence:
π₯ Must-Do Problems for Beginners
1. Arrays & Hashing π§©
βοΈ Two Sum (π‘ Hash Map)
βοΈ Best Time to Buy and Sell Stock (π‘ Greedy)
βοΈ Contains Duplicate (π‘ Set)
βοΈ Product of Array Except Self (π‘ Prefix Product)
βοΈ Majority Element (π‘ Boyer-Moore)
2. Strings & Sliding Window βοΈ
βοΈ Valid Anagram (π‘ Hashing)
βοΈ Longest Substring Without Repeating Characters (π‘ Sliding Window)
βοΈ Reverse String (π‘ Two Pointers)
βοΈ First Unique Character in a String (π‘ Hash Map)
βοΈ Implement strStr() (π‘ String Search)
3. Binary Search π
βοΈ Binary Search (π‘ Classic)
βοΈ Find First and Last Position of Element in Sorted Array (π‘ Modified Binary Search)
βοΈ Search a 2D Matrix (π‘ Matrix Binary Search)
βοΈ Guess Number Higher or Lower (π‘ Simple Binary Search)
4. Two Pointers π€
βοΈ Merge Sorted Array
βοΈ Move Zeroes
βοΈ Two Sum II – Input Array is Sorted
βοΈ Valid Palindrome
βοΈ Container With Most Water
5. Dynamic Programming (Easy Intro) π
βοΈ Climbing Stairs (π‘ Fibonacci DP)
βοΈ House Robber (π‘ Simple DP)
βοΈ Maximum Subarray (π‘ Kadane’s Algorithm)
βοΈ Unique Paths (π‘ Grid DP)
βοΈ Coin Change (π‘ Classic DP)
π οΈ How to Approach These Problems?
1οΈβ£ Understand the problem statement (write it in your own words).
2οΈβ£ Identify the best approach (brute force → optimized).
3οΈβ£ Write code & debug (use print statements if needed).
4οΈβ£ Optimize using better techniques (hash maps, two pointers, DP).
5οΈβ£ Repeat & practice (do similar problems to reinforce learning).