Skip to content

RikamPalkar/leetcode-75

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 

Repository files navigation

📘 leetcode-75

LeetCode 75 Study Plan – 75 Handpicked Problems Across 23 DSA Topics
🔗 Leetcode's Study Plan

This is a collection of my solutions to LeetCode 75 problems, organized by problem number.


Overview

Each solution includes:

  • Intuitive approach
  • Example walkthrough
  • Well-structured code
  • Time and space complexity analysis

Why LeetCode 75?

If you're a beginner preparing for coding interviews or you're just brushing up on fundamentals, the LeetCode 75 plan:

  • Covers all critical DSA patterns
  • Progresses from easy > medium > hard
  • Builds problem-solving confidence
  • Saves time by removing decision fatigue (no need to pick problems yourself)

It’s interview-focused, topic-based, and battle-tested.


📂 How to Use This Repository

Each topic is documented in a dedicated section with:

  • A table of problems
  • Problem link
  • Data Structures used
  • Time and space complexity
  • Direct link to my solution in this repo

Perfect for revision, practice, and interview prep.


Topics

  1. Arrays / Strings
  2. Two Pointers
  3. Sliding Window
  4. Prefix Sum
  5. Hash Map / Hash Set
  6. Stack
  7. Queue
  8. Linked List
  9. Binary Tree (DFS)
  10. Binary Tree (BFS)
  11. Binary Search Tree
  12. Graphs (DFS)
  13. Graphs (BFS)
  14. Heap / Priority Queue
  15. Binary Search
  16. Backtracking
  17. Dynamic Programming (1D)
  18. Dynamic Programming (Multi Multidimensional)
  19. Bit Manipulation
  20. Trie
  21. Intervals
  22. Monotonic Stack

Array and String

Sr. No. Problem Name Data Structures Time Complexity Space Complexity Solution Link
1 Merge Strings Alternately String, Two Pointers O(n + m) O(n + m) Code
2 Greatest Common Divisor of Strings String, Math O(n + m) O(n + m) Code
3 Kids With the Greatest Number of Candies Array O(n) O(n) Code
4 Can Place Flowers Array, Greedy O(n) O(1) Code
5 Reverse Vowels of a String String, Two Pointers O(n) O(n) Code
6 Reverse Words in a String String, Two Pointers O(n) O(n) Code
7 Product of Array Except Self Array, Prefix Sum O(n) O(n) Code
8 Increasing Triplet Subsequence Array, Greedy O(n) O(1) Code
9 String Compression Array, Two Pointers O(n) O(1) Code

Two Pointers

Sr. No. Problem Name Data Structures Time Complexity Space Complexity Solution Link
10 Move Zeroes Array, Two Pointers O(n) O(1) Code
11 Is Sequence String, Two Pointers, Dynamic Programming O(n) O(1) Code
12 Container With Most Water Array, Two Pointers, Greedy O(n) O(1) Code
13 Max Number of K-Sum Pairs Array, Hash Table, Two Pointers, Sorting O(n) O(n) Code

Sliding Window

Sr. No. Problem Name Data Structures Time Complexity Space Complexity Solution Link
14 Maximum Average Subarray I Array, Sliding Window O(n) O(1) Code
15 Maximum Number of Vowels in a Substring of Given Length String, Sliding Window O(n) O(1) Code
16 Max Consecutive Ones III Array, Binary Search, Sliding Window, Prefix Sum O(n) O(1) Code
17 Longest Subarray of 1's After Deleting One Element Array,Sliding Window, Dynamic Programming O(n) O(1) Code

Prefix Sum

Sr. No. Problem Name Data Structures Time Complexity Space Complexity Solution Link
18 Find the Highest Altitude Array, Prefix Sum O(n) O(1) Code
19 Find Pivot Index Array, Prefix Sum O(n) O(1) Code

Hash Map / Hash Set

Sr. No. Problem Name Data Structures Used Time Complexity Space Complexity Solution Link
20 Find the Difference of Two Arrays Hash Set, Array O(n + m) O(n + m) Code
21 Unique Number of Occurrences Hash Map, Hash Set, Array O(n) O(n) Code
22 Determine if Two Strings Are Close Hash Map, Sorting, String, Counting O(n + k log n) O(k) Code
23 Equal Row and Column Pairs Hash Map, Array, Matrix, Simulation O(n²) O(n²) Code

Stack

Sr. No. Problem Name Data Structures Used Time Complexity Space Complexity Solution Link
24 Removing Stars From a String Stack, String, Simulation O(n) O(n) Code
25 Asteroid Collision Stack, Array, Simulation O(n) O(n) Code
26 Decode String Stack, String, Recursion O(n*k) O(n) Code

Queue

Sr. No. Problem Name Data Structures Used Time Complexity Space Complexity Solution Link
27 Number of Recent Calls Queue, Data Stream O(n) O(n) Code
28 Dota2 Senate Queue, Greedy, String O(n) O(n) Code

Linked List

Sr. No. Problem Name Data Structures Used Time Complexity Space Complexity Solution Link
29 Delete the Middle Node of a Linked List Linked List, Two Pointers O(n) O(1) Code
30 Odd Even Linked List Linked List O(n) O(1) Code
31 Reverse Linked List Linked List O(n) O(1) Code
32 Maximum Twin Sum of a Linked List Linked List, Two Pointers, Stack O(n) O(1) Code

Binary Tree – DFS

Sr. No. Problem Name Data Structures Used Time Complexity Space Complexity Solution Link
33 Maximum Depth of Binary Tree Binary Tree, DFS O(n) O(h) Code
34 Leaf-Similar Trees Binary Tree, DFS O(n + m) O(h1 + h2 + l) Code
35 Count Good Nodes in Binary Tree Binary Tree, DFS O(n) O(h) Code
36 Path Sum III Binary Tree, DFS O(n²) O(h) Code
37 Longest ZigZag Path in a Binary Tree Binary Tree, DFS, DP O(n) O(h) Code
38 Lowest Common Ancestor of a Binary Tree Binary Tree, DFS O(n) O(h) Code

Binary Tree – BFS

Sr. No. Problem Name Data Structures Used Time Complexity Space Complexity Solution Link
39 Binary Tree Right Side View Binary Tree, BFS O(n) O(w) Code
40 Maximum Level Sum of a Binary Tree Binary Tree, BFS O(n) O(w) Code

Binary Search Tree

Sr. No. Problem Name Data Structures Used Time Complexity Space Complexity Solution Link
41 Search in a Binary Search Tree Binary Search Tree, DFS O(h) O(h) Code
42 Delete Node in a BST Binary Search Tree, DFS O(h) O(h) Code

Graphs - DFS

Sr. No. Problem Name Data Structures Used Time Complexity Space Complexity Solution Link
43 Keys and Rooms Graph, DFS O(V + E) O(v) Code
44 Number of Provinces Union Find, Graph, DFS O(n^2 * α(n)) O(n) Code
45 Reorder Routes to Make All Paths Lead to the City Zero Graph, DFS O(n) O(n) Code
46 Evaluate Division Graph, DFS, Array, String, Union Find, Shortest Path O(E + Q * V) O(V + E) Code

Graphs - BFS

Sr. No. Problem Name Data Structures Used Time Complexity Space Complexity Solution Link
47 Nearest Exit from Entrance in Maze Graph, BFS, Matrix, Queue O(m × n) O(m × n) Code
48 Rotting Oranges Graph, BFS Matrix, Queue O(m × n) O(m × n) Code

Heap / Priority Queue

Sr. No. Problem Name Data Structures Used Time Complexity Space Complexity Solution Link
49 Kth Largest Element in an Array Array, Heap (Priority Queue) O(n + k log n) O(k) Code
50 Smallest Number in Infinite Set Hash Table, Heap O(log n) O(n) Code
51 Maximum Subsequence Score Array, Greedy, Heap O(n log n) O(n) Code
52 Total Cost to Hire K Workers Array, Two Pointers, Heap O(n log n) O(n) Code

Binary Search

Sr. No. Problem Name Data Structures Used Time Complexity Space Complexity Solution Link
53 Guess Number Higher or Lower Binary Search, Interactive O(log n) O(1) Code
54 Successful Pairs of Spells and Potions Array, Two Pointers, Binary Search, Sorting O(n log m) O(n + m) Code
55 Find Peak Element Array, Binary Search O(log n) O(1) Code
56 Koko Eating Bananas Array, Binary Search O(n log m) O(1) Code

Backtracking

Sr. No. Problem Name Data Structures Used Time Complexity Space Complexity Solution Link
57 Letter Combinations of a Phone Number Hash Table, String, Backtracking O(4^n · n) O(n) Code
58 Combination Sum III Array, Backtracking O(9 choose k) O(k) Code

Dynamic Programming (1D)

Sr. No. Problem Name Data Structures Used Time Complexity Space Complexity Solution Link
59 N-th Tribonacci Number Math, DP, Memoization O(n) O(n) Code
60 Min Cost Climbing Stairs Array, DP O(n) O(1) Code
61 House Robber Array, DP O(n) O(1) Code
62 Domino and Tromino Tiling DP O(n) O(n) Code

Dynamic Programming (Multidimensional)

Sr. No. Problem Name Data Structures Used Time Complexity Space Complexity Solution Link
63 Unique Paths Math, DP, Combinatorics O(m × n) O(m × n) Code
64 Longest Common Subsequence String, DP O(m × n) O(m × n) Code
65 Best Time to Buy and Sell Stock with Transaction Fee Array, DP, Greedy O(n) O(n) Code
66 Edit Distance String, DP O(m × n) O(m × n) Code

Bit Manipulation

Sr. No. Problem Name Data Structures Used Time Complexity Space Complexity Solution Link
67 Counting Bits DP, Bit Manipulation O(n) O(n) Code
68 Single Number Array, Bit Manipulation O(n) O(1) Code
69 Minimum Flips to Make a OR b Equal to c Bit Manipulation O(1) (fixed bits) O(1) Code

Trie

Sr. No. Problem Name Data Structures Used Time Complexity Space Complexity Solution Link
70 Implement Trie (Prefix Tree) Trie, Hash Table, String, Design O(m) O(m × n) Code
71 Search Suggestions System Trie, Heap, Array, String, Binary Search, Sorting O(m log n) O(n × m) Code

Intervals

Sr. No. Problem Name Data Structures Used Time Complexity Space Complexity Solution Link
72 Non-overlapping Intervals Array, DP, Greedy, Sorting O(n log n) O(n) Code
73 Minimum Number of Arrows to Burst Balloons Array, Greedy, Sorting O(n log n) O(n) Code

Monotonic Stack

Sr. No. Problem Name Data Structures Used Time Complexity Space Complexity Solution Link
74 Daily Temperatures Array, Stack, Monotonic Stack O(n) O(n) Code
75 Online Stock Span Stack, Design, Monotonic Stack, Data Stream O(n) O(n) Code

Looking for More?

Check out my companion repository:
🔗 DSA Simplified – A complete walkthrough of all major DSA topics, with LeetCode, GFG, and custom examples.


License

This project is open-sourced under the MIT License. Feel free to use, fork, and share!
See LICENSE for more details.


🙏 Thanks!

Thanks to everyone who’s exploring this repo.
I hope it helps you crack interviews, ace coding rounds, and most importantly – become a better problem solver.

If you found this helpful, ⭐ star the repo and share it with your peers!

Happy coding!
Rikam Palkar

About

LeetCode 75 Study Plan – 75 handpicked problems across 20+ DSA topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages