🧩

DSA Problem Sheets

Data Structures & Algorithms

📋 125 Problems● Easy 57● Medium 58● Hard 10
Showing 125 of 125 problems
#
Title
Difficulty
1
Determine If an Array Is Already Sorted
Easy
2
Find a Pair That Sums to a Target in a Sorted Array
Easy
3
Find Largest Element in an Array
Easy
4
Find Second Largest Element in an Array
Easy
5
Find the Missing Number in a Sequence
Easy
6
Merge Two Sorted Arrays Into the First Array In Place
Easy
7
Produce the Sorted List of Squared Values
Easy
8
Remove Repeated Values from a Sorted Array
Easy
9
Replace Each Element with the Maximum Element to Its Right
Easy
10
Reverse an Array
Easy
11
Shift All Zeros to the End of the Array
Easy
12
Cyclically Shift an Array by K Steps
Medium
13
Find the Repeated Number in an Array
Medium
14
Find the Triplet Sum Nearest to a Target Value
Medium
15
List Every Unique Quadruplet That Sums to a Target
Medium
16
List Every Unique Triplet That Sums to Zero
Medium
17
Maximum Water Trapped Between Two Vertical Lines
Medium
18
Minimum Rescue Boats Needed Under a Weight Limit
Medium
19
Sort an Array Containing Only 0s, 1s, and 2s
Medium
20
Total Rainwater Trapped Across an Elevation Map
Hard
21
Two Sum
Hard
22
Check If a Sentence Reads the Same Ignoring Case and Symbols
Easy
23
Valid Anagram
Easy
24
Valid Parentheses
Easy
25
Maximum Sum Subarray of Size K
Medium
26
Longest Run of Consecutive Ones
Easy
27
Longest Run of Ones After K Flips
Medium
28
Count Subarrays With Product Less Than K
Medium
29
Longest Subarray With At Most Two Distinct Values
Medium
30
Smallest Subarray With Sum At Least Target
Medium
31
Check If a String Contains a Permutation of Another
Medium
32
Maximum of Every Sliding Window of Size K
Hard
33
Cumulative Sum of an Array
Easy
34
Answer a Range Sum Query on an Array
Easy
35
Find the Equilibrium Index of an Array
Easy
36
Longest Subarray With Sum Equal to K
Medium
37
Count Subarrays Summing to K
Medium
38
Product of All Elements Except Self
Medium
39
Largest Sum of Any Contiguous Subarray
Medium
40
Largest Product of Any Contiguous Subarray
Medium
41
Largest Sum Subarray in a Circular Array
Hard
42
Maximum Profit From One Buy and One Sell
Easy
43
Check If an Array Contains Any Duplicate
Easy
44
Length of the Longest Run of Consecutive Numbers
Medium
45
Find the Element Appearing More Than Half the Time
Easy
46
Find All Elements Appearing More Than a Third of the Time
Medium
47
List Every Number That Appears Twice
Medium
48
Sum of Both Diagonals of a Square Matrix
Easy
49
Transpose of a Matrix
Easy
50
Zero Out Rows and Columns Containing a Zero
Medium
51
Traverse a Matrix in Spiral Order
Medium
52
Rotate a Square Matrix 90 Degrees Clockwise
Medium
53
Reverse a String In-Place
Easy
54
Length of the Last Word in a Sentence
Easy
55
Longest Common Prefix of an Array of Strings
Easy
56
Reverse the Order of Words in a Sentence
Medium
57
Add Two Binary Strings
Easy
58
Compress a String Using Run-Length Encoding
Medium
59
Multiply Two Numbers Represented as Strings
Hard
60
Convert a Roman Numeral to an Integer
Medium
61
Remove the Outermost Parentheses From Every Primitive Group
Easy
62
Check If One String Is a Rotation of Another
Easy
63
Find the First Non-Repeating Character in a String
Easy
64
Group Strings That Are Anagrams of Each Other
Medium
65
Check if Two Strings Are Isomorphic
Easy
66
Sort Characters of a String by Frequency
Medium
67
Longest Substring With All Unique Characters
Medium
68
Find All Starting Indices of Anagrams in a String
Medium
69
Longest Substring After At Most K Character Replacements
Medium
70
Smallest Window Containing All Characters of Another String
Hard
71
Palindrome After Deleting At Most One Character
Easy
72
Check If a String Is a Subsequence of Another String
Easy
73
Reverse Only the Vowels of a String
Easy
74
Compare Strings After Simulating Backspace Characters
Easy
75
Build a Linked List From an Array of Values
Easy
76
Insert a Node at the Beginning of a Linked List
Easy
77
Insert a Node at the End of a Linked List
Easy
78
Insert a Node at a Given Position in a Linked List
Medium
79
Delete the First Node of a Linked List
Easy
80
Delete a Node at a Given Position in a Linked List
Medium
81
Delete the Last Node of a Linked List
Medium
82
Search for a Value in a Linked List
Easy
83
Traverse a Linked List and Collect Its Values
Easy
84
Find the Length of a Linked List
Easy
85
Find the Middle Node of a Linked List
Easy
86
Detect a Loop in a Linked List
Easy
87
Find the First Node of a Loop in a Linked List
Medium
88
Remove a Loop in a Linked List
Medium
89
Find the Kth Node From the End of a Linked List
Easy
90
Remove the Nth Node From the End of a Linked List
Medium
91
Delete the Middle Node of a Linked List
Medium
92
Merge Two Sorted Linked Lists Into One
Easy
93
Remove Duplicate Values From a Sorted Linked List
Easy
94
Remove All Nodes With Duplicate Values From a Sorted List
Medium
95
Sort the Nodes of a Linked List
Medium
96
Merge K Sorted Linked Lists Into One
Hard
97
Find the Node Where Two Linked Lists Intersect
Easy
98
Reverse a Sublist of a Linked List
Medium
99
Pairwise Swap Nodes in a Linked List
Medium
100
Rotate a Linked List to the Right
Medium
101
Check if a Linked List Is a Palindrome
Easy
102
Reorder a Linked List
Medium
103
Reverse a Linked List in Groups of K
Hard
104
Locate a Value's Position in a Sorted Array
Easy
105
Compute the Floor of a Number's Square Root
Easy
106
Find Where a Value Belongs in a Sorted Array
Easy
107
Find a Value in an Array Rotated at an Unknown Pivot
Medium
108
Find a Value in a Rotated Sorted Array That May Contain Duplicates
Medium
109
Find the Smallest Element After a Sorted Array Is Rotated
Medium
110
Find Any Local Maximum in an Array
Medium
111
Find the Lower Bound of a Target in a Sorted Array
Easy
112
Find the Upper Bound of a Target in a Sorted Array
Easy
113
Find the Start and End Indices of a Target in a Sorted Array
Medium
114
Count How Many Times a Number Appears in a Sorted Array
Easy
115
Find the Floor and Ceiling of a Number in a Sorted Array
Easy
116
Find a Value in a Matrix Sorted Like a Flattened Array
Medium
117
Find a Value in a Matrix With Sorted Rows and Columns
Medium
118
Find the Row Containing the Most 1s in a Binary Matrix
Medium
119
Find Any Local Maximum in a 2D Matrix
Hard
120
Find the Median of All Elements in a Row-Sorted Matrix
Hard
121
Increment a Number Stored as a Linked List
Easy
122
Add Two Numbers Stored in Reverse Order
Medium
123
Add Two Numbers Stored in Forward Order
Medium
124
Find the Next Greater Value for Each Node in a Linked List
Medium
125
Remove Nodes With a Greater Value Somewhere to Their Right
Medium