icon picker
DSA Questions - FULL LIST

Last edited 2 hours ago by XS.

2
info
Keep your meetings on track. Slide to set your time frame, or right-click the slider to edit timer settings.
3
info

Set Timer for
000
10
minutes →
Start Timer
-

End time:
Thursday 12:00 AM

DSA Leetcode Questions Cheat sheets
Search
Category
No.
Problem Name
Difficulty (% Effort)
STATUS
Python
C++
Rust
URL
Scale
Number
Rev. Count
ALGO (if used)
Notes
Text
287
Find The Duplicate Number
00
2
00
2
Floyd’s Algo - not implemented
75
Sort Colors
00
2
00
1
Used simple Insertion sort. Or counting sort with multiple passes.
26
Remove Duplicates From Sorted Array
00
2
00
2
using set() or dict(). (set or vector for c++)
(HashSet or HashMap)
73
Set Matrix Zeroes
00
2
00
1
separate loops, scan and edit inplace
283
Move Zeroes
00
2
00
1
2 pointers Tricky - removing the “swap redundancy” logic
121
Best Time To Buy And Sell Stock
00
3
00
1
keep track of previous days minimum buy.
Chocolate Distribution Problem
00
1
00
sliding window and simple loop adjustments
1
Two Sum
00
2
00
hashmap or dictionary
122
Best Time To Buy And Sell Stock II
00
2
00
2
greedy, basically selling and buying again when a dip in price is found
974
Subarray Sums Divisible By K
00
2
00
2
HashMap + modulo arithmetic.
Tricky to visualize the subarrays on each step
Find All Duplicates In An Array
00
2
00
2
sort then loop through.
HashMap if not space constraints
specific use case (optimized)
Container With Most Water
00
00
3sum
00
1
00
single loop + 2 pointers
check for duplicates on outer as well as inner loops
4sum
00
00
Maximum Points You Can Obtain From Cards
00
1
00
sliding window, but for the remaining items.
convert right index to +ve if -ve
Subarray Sum Equals K
00
1
00
visualization is done using the approach of finding the number of times k less pref_sum were present.
Spiral Matrix
00
00
Word Search
00
1
00
backtracking
recursive approach
O(m * n * 4^L)
Jump Game
00
00
Merge Sorted Array
00
0
00
Majority Element
00
00
Reverse Pairs
00
00
Print All Possible Combinations Of R Elements In A Given Array Of Size N
00
00
Game Of Life
00
00
Max Value Of Equation
00
00
Insert Delete Getrandom O1 Duplicates Allowed
00
00
Largest Rectangle In Histogram
00
00
Max Value Of Equation
00
00
Valid Parentheses
00
1
00
Print All The Duplicates In The Input String
00
1
00
Implement Strstr
00
1
00
not really a 2 pointers just single pointer with right side handling to prevent out of bounds
Longest Common Prefix
00
1
00
take first word as prefix answer
compare with the next word, modify if necessary
keep doing it with next words
Valid Palindrome Ii
00
1
00
just call the similar function again in case of not match
Integer To Roman
00
00
Generate Parentheses
00
1
00
see the rust part for the backtracking and push pop.
Simplify Path
00
1
00
uses stack or queue
find all the valid folders of the path, put them into the stack
construct the path again
Smallest Window In A String Containing All The Characters Of Another String 1587115621
00
00
Reverse Words In A String
00
00
Rabin Karp Algorithm For Pattern Searching
00
00
Group Anagrams
00
00
Word Wrap1646
00
00
Basic Calculator Ii
00
00
Valid Number
00
00
Integer To English Words
00
00
Minimum Window Substring
00
1
00
Text Justification
00
00
Boyer Moore Algorithm For Pattern Searching
00
00
Distinct Subsequences
00
00
Maximum Size Rectangle Binary Sub Matrix 1s
00
00
Find Number Of Islands
00
00
Given Matrix O X Replace O X Surrounded X
00
00
Spiral Matrix
00
00
Rotate Image
00
00
Minimum Moves To Equal Array Elements
00
00
Add Binary
00
00
Maximum Product Of Three Numbers
00
00
Excel Sheet Column Title
00
00
Happy Number
00
00
Palindrome Number
00
00
Missing Number
00
00
Reverse Integer
00
00
Power Of Two
00
00
Max Points On A Line
00
00
Valid Square
00
00
The Kth Factor Of N
00
00
Permute Two Arrays Sum Every Pair Greater Equal K
00
00
Ceiling In A Sorted Array
00
00
Find A Pair With The Given Difference
00
00
Permute Two Arrays Sum Every Pair Greater Equal K
00
00
Check Reversing Sub Array Make Array Sorted
00
00
Radix Sort
00
00
A Product Array Puzzle
00
1
00
Make Array Elements Equal Minimum Cost
00
00
162
Find Peak Element
00
1
00
simple ambiguous (very easy as the answer may not be unique)
Binary search is not mandatory
Allocate Minimum Number Of Pages0937
00
00
Minimum Number Swaps Required Sort Array
00
00
AGGRCOW (SPOJ)
00
00
33
Search In Rotated Sorted Array
00
00
Count Of Smaller Numbers After Self
00
00
Split Array Largest Sum
00
00
876
Middle Of The Linked List
00
1
00
slow fast pointers, 2 pointers
141
Linked List Cycle
00
1
00
slow fast pointers, 2 pointers
1290
Convert Binary Number In A Linked List To Integer
00
00
83
Remove Duplicates From Sorted List
00
00
Sort A Linked List Of 0s 1s Or 2s
00
00
203
Remove Linked List Elements
00
1
00
21
Merge Two Sorted Lists
00
00
Multiply Two Numbers Represented Linked Lists
00
00
160
Intersection Of Two Linked Lists
00
1
00
method 1: using set
method 2: using 2 pointers (saves space)
Given Only A Pointer To A Node To Be Deleted In A Singly Linked List How Do You Delete It
00
00
234
Palindrome Linked List
00
1
00
method 1: using list
method 2: using 2 pointers, multiple separate loops and reversing the remaining half list to compare
206
Reverse Linked List
00
1
00
keep the track of prev node, start with prev = None in python
2
Add Two Numbers
00
00
td 138
Copy List With Random Pointer
00
00
Add Two Numbers Ii
00
00
Reverse Linked List Ii
00
00
Reorder List
00
00
Remove Nth Node From End Of List
00
00
Flatten A Multilevel Doubly Linked List
00
00
Partition List
00
00
Remove Duplicates From Sorted List Ii
00
00
Linked List In Zig Zag Fashion
00
00
Sort List
00
00
Segregate Even And Odd Elements In A Linked List
00
00
Rearrange A Given Linked List In Place
00
00
Merge K Sorted Lists
00
00
Reverse Nodes In K Group
00
00
Merge Sort For Linked List
00
00
Flattening A Linked List
00
00
Subtract Two Numbers Represented As Linked Lists
00
00
Implement Queue Using Stacks
00
00
Backspace String Compare
00
00
Implement Stack Using Queues
00
00
Implement Stack Queue Using Deque
00
00
Next Greater Element I
00
00
Stack Set 4 Evaluation Postfix Expression
00
00
Implement Two Stacks In An Array
00
00
Minimum Cost Tree From Leaf Values
00
00
Daily Temperatures
00
00
Distance Of Nearest Cell Having 1 1587115620
00
00
Online Stock Span
00
00
Rotten Oranges2536
00
00
Sum Of Subarray Minimums
00
00
Evaluate Reverse Polish Notation
00
00
Circular Tour
00
00
Remove All Adjacent Duplicates In String Ii
00
00
Flatten Nested List Iterator
00
00
Find The Maximum Of Minimums For Every Window Size In A Given Array
00
00
Lru Cache Implementation
00
00
The Celebrity Problem
00
00
Diameter Of Binary Tree
00
00
Invert Binary Tree
00
00
Subtree Of Another Tree
00
00
Range Sum Of Bst
00
00
Symmetric Tree
00
00
Convert Sorted Array To Binary Search Tree
00
00
Merge Two Binary Trees
00
00
Maximum Depth Of Binary Tree
00
00
Binary Tree Paths
00
00
Same Tree
00
00
Lowest Common Ancestor Of A Binary Search Tree
00
00
Path Sum
00
00
Minimum Absolute Difference In Bst
00
00
Sum Of Left Leaves
00
00
Balanced Binary Tree
00
00
Predecessor And Successor
00
00
Binary Tree Inorder Traversal
00
00
Check Whether Bst Contains Dead End
00
00
Binary Search Tree Iterator
00
00
Lowest Common Ancestor Of A Binary Tree
00
00
Unique Binary Search Trees Ii
00
00
All Nodes Distance K In Binary Tree
00
00
Validate Binary Search Tree
00
00
Binary Tree Right Side View
00
00
Redundant Connection
00
00
Binary Tree Level Order Traversal
00
00
Path Sum Iii
00
00
Construct Binary Tree From Preorder And Postorder Traversal
00
00
Unique Binary Search Trees
00
00
Recover Binary Search Tree
00
00
Populating Next Right Pointers In Each Node
00
00
Flatten Binary Tree To Linked List
00
00
Maximum Width Of Binary Tree
00
00
Min Distance Between Two Given Nodes Of A Binary Tree
00
00
Kth Smallest Element In A Bst
00
00
Binary Tree Zigzag Level Order Traversal
00
00
Count Bst Nodes That Lie In A Given Range
00
00
Preorder To Postorder4423
00
00
Binary Tree To Dll
00
00
Binary Tree Maximum Path Sum
00
00
Sum Of Distances In Tree
00
00
Binary Tree Cameras
00
00
Vertical Order Traversal Of A Binary Tree
00
00
Print K Sum Paths Binary Tree
00
00
Serialize And Deserialize Binary Tree
00
00
Find Median Bst Time O1 Space
00
00
Largest Bst Binary Tree Set 2
00
00
Construct Bst From Given Preorder Traversa
00
00
Bfs Traversal Of Graph
00
00
Depth First Search Or Dfs For A Graph
00
00
Number Of Islands
00
00
Flood Fill
00
00
Rat In A Maze Problem
00
00
Detect Cycle In An Undirected Graph
00
00
Detect Cycle In A Graph
00
00
Steps By Knight5927
00
00
Decode String
00
00
Shortest Bridge
00
00
Number Of Operations To Make Network Connected
00
00
Find Eventual Safe States
00
00
Strongly Connected Components Kosarajus Algo
00
00
Time Needed To Inform All Employees
00
00
Graph Coloring Applications
https://www.geeksforgeeks.org/graph-coloring-applications/#:~:text=Graph%20coloring%20problem%20is%20toare%20colored%20using%20same%20color.
00
00
Most Stones Removed With Same Row Or Column
00
00
As Far From Land As Possible
00
00
Find The City With The Smallest Number Of Neighbors At A Threshold Distance
00
00
Find Whether It Is Possible To Finish All Tasks Or Not From Given Dependencies
00
00
Prims Minimum Spanning Tree Mst Greedy Algo 5
00
00
Implementing Floyd Warshall2042
00
00
Evaluate Division
00
00
Snakes And Ladders
00
00
Topological Sort
00
00
Cheapest Flights Within K Stops
00
00
Detect Negative Cycle Graph Bellman Ford
00
00
Bipartite Graph
00
00
Longest Increasing Path In A Matrix
00
00
Making A Large Island
00
00
Remove Boxes
00
00
Critical Connections In A Network
00
00
Alien Dictionary
00
00
Water Jug Problem Using Bfs
00
00
Travelling Salesman Problem Set 1
00
00
Total Number Spanning Trees Graph
00
00
Word Ladder
00
00
Minimize Cash Flow Among Given Set Friends Borrowed Money
00
00
Design Add And Search Words Data Structure
00
00
Word Break Problem Trie Solution
00
00
Trie Insert And Search
00
00
K Anagrams 1
00
00
Palindrome Pairs
00
00
Phone Directory
00
00
Top K Frequent Elements
00
00
Kth Largest Element In An Array
00
00
Ugly Number Ii
00
00
Furthest Building You Can Reach
00
00
Kth Smallest Element In A Sorted Matrix
00
00
Reorganize String
00
00
Find The Most Competitive Subsequence
00
00
Smallest Positive Missing Number 1587115621
00
00
Largest Subarray With 0 Sum
00
00
K Closest Points To Origin
00
00
Minimum Number Of Refueling Stops
00
00
Minimum Cost To Hire K Workers
00
00
Swim In Rising Water
00
00
Sliding Window Maximum
00
00
Climbing Stairs
00
00
Maximum Product Subarray
00
00
Ones And Zeroes
00
00
Counting Bits
00
00
Knight Dialer
00
00
Cutted Segments1642
00
00
Unique Paths
00
00
Minimum Path Sum
00
00
Coin Change
00
00
Decode Ways
00
00
Maximum Length Of Repeated Subarray
00
00
Longest Increasing Subsequence
00
00
Longest Common Substring1452
00
00
Count Square Submatrices With All Ones
00
00
Maximal Square
00
00
Mobile Numeric Keypad5456
00
00
Weighted Job Scheduling
00
00
Delete And Earn
00
00
Range Sum Query 2d Immutable
00
00
Optimal Binary Search Tree Dp 24
00
00
Frog Jump
00
00
Best Time To Buy And Sell Stock Iv
00
00
Minimum Insertion Steps To Make A String Palindrome
00
00
Largest Area Rectangular Sub Matrix Equal Number 1s 0s
00
00
Trapping Rain Water
00
00
Minimum Cost To Merge Stones
00
00
Count Different Palindromic Subsequences
00
00
Maximal Rectangle
00
00
Burst Balloons
00
00
Super Egg Drop
00
00
Sort Colors
00
00
Longest Repeating Character Replacement
00
00
Maximum Number Of Visible Points
00
00
Gas Station
00
00
Minimum Cost For Acquiring All Coins With K Extra Coins Allowed With Every Coin
00
00
Restore The Array From Adjacent Pairs
00
00
Task Scheduler
00
00
Minimum Deletions To Make Character Frequencies Unique
00
00
Remove K Digits
00
00
CHOCOLA (SPOJ)
00
00
Non Overlapping Intervals
00
00
Minimum Deletion Cost To Avoid Repeating Letters
00
00
Minimum Sum Two Numbers Formed Digits Array 2
00
00
Combination Sum Ii
00
00
Subset Sum Problem2014
00
00
Combinations
00
00
Subsets Ii
00
00
M Coloring Problem 1587115620
00
00
Beautiful Arrangement
00
00
Palindrome Partitioning
00
00
Permutations Ii
00
00
Word Search Ii
00
00
Sudoku Solver
00
00
N Queens
00
00
Unique Paths Iii
00
00
Find Maximum Number Possible By Doing At Most K Swaps
00
00
Partition Set K Subsets Equal Sum
00
00
Tug Of War
00
00
Find Paths From Corner Cell To Middle Cell In Maze
00
00
Solving Cryptarithmetic Puzzles Backtracking 8
00
00
Print Palindromic Partitions String
00
00
Range Sum Query Immutable
00
00
Range Sum Query Mutable
00
00
Count Of Smaller Numbers After Self
00
00
Count Of Range Sum
00
00
There are no rows in this table
5

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.