Collection of my solutions to Striver's SDE Sheet.
Day 1 : Arrays
Problem | Solution |
---|---|
Set Matrix Zeroes | Link |
Pascal's Triangle | Link |
Next Permutation | Link |
Kadane’s Algorithm | Link |
Sort an array of 0’s 1’s 2’s | Link |
Stock buy and Sell | Link |
Day 2 : Arrays-II
Day 3 : Arrays-III
Problem | Solution |
---|---|
Search in a 2d Matrix | Link |
Pow(x,n) | Link |
Majority Element (>N/2 times) | Link |
Majority Element (>N/3 times) | Link |
Grid Unique Paths | Link |
Reverse Pairs | Link |
Day 4 : Arrays-IV
Problem | Solution |
---|---|
2-Sum-Problem | |
4-sum-Problem | |
Longest Consecutive Sequence | |
Largest Subarray with 0 sum | |
Count number of subarrays with given Xor K | |
Longest Substring without repeat |
Day 5 : Linked List
Problem | Solution |
---|---|
Reverse a LinkedList | |
Find the middle of LinkedList | |
Merge Sorted LinkedList | |
Remove N-th node from back of LinkedList | |
Add two numbers as LinkedList | |
Delete a given node |
Day 6 : Linked List-II
Day 7 : Linked List and Arrays
Problem | Solution |
---|---|
Rotate a LinkedList | |
Clone a Linked List with random and next pointer | |
3 sum | |
Trapping rainwater | |
Remove Duplicate from Sorted array | |
Max consecutive ones |
Day 8 : Greedy Algorithm
Problem | Solution |
---|---|
N meetings in one room | |
Minimum Platforms | |
Job sequencing Problem | |
Fractional Knapsack Problem | |
Minimum number of coins | |
Activity Selection |