Striver-SDE-Sheet

Repository containing solution for #SdeSheetChallenge by striver

View the Project on GitHub

Striver-SDE-Sheet

Find complete SDE-SHEET on TakeUForward.

Day-1 (Arrays-I)

No. Problem
1. Set Matrix Zeros
2. Pascal Triangle
3 . Next Permutation
4. Maximum sum Subarray
5. Sort 0 1 2
6. Best Time to Buy and Sell Stock

Day-2 (Arrays-II)

No. Problem
2. Merge intervals
3. Merge two sorted arrays
4. Find Duplicate in Array
5. Repeating and missing number
6. Count Inversions

Day - 3 (Arrays-III)

No. Problems
1. Search in a 2D matrix
2. Pow(X,n)
3. Majority Element (>N/2 times)
4. Majority Element (>N/3 times)
5. Grid Unique Paths
6. Reverse Pairs (Leetcode)

Day-4 (Hashing)

No. Problems
1. 2 sum problem
2. 4 sum problem
3. Longest Consecutive Sequence
4. Largest Subarray with 0 sum
5. Count number of subarrays with given XOR
6. Longest substring without repeat

Day - 5 (Linked List)

No. Problems
1. Reverse a LinkedList
2. Find middle of linked list
3. Merge two sorted linked list
4. Remove Nth node from back
5. Delete a Given node O(1)
6. Add two numbers as linked list

Day - 6 (Linked List)

Sn. Problems
1. Find intersection point of Y LinkedList
2. Detect a cycle in Linked List
3. Reverse a LinkedList in groups of size k.
4. Check if a LinkedList is palindrome or not.
5. Find the starting point of the Loop of LinkedList
6. Flattening of a LinkedList

Day - 7 (2 Pointers)

Sn. Problems
1. Rotate linked list
2. Clone Linked List with random and next pointer
3. 3 sum
4. Trapping rainwater
5. Remove Duplicate from Sorted array
6. Max consecutive ones

Day - 8 (Greedy)

Sn. Problems
1. N meeting in one room
2. Minimum number of platforms required for a railway
3. Job sequencing Problem
4. Fractional Knapsack Problem
5. Greedy algorithm to find minimum number of coins
6. Activity Selection (it is same as N meeting in one room

Day - 9 (Recursion)

Sn. Problems
1. Subset sum
2. Subset sum-II
3. Combination sum-1
4. Combination sum-2
5. Palindrome Partitioning
6. K-th permutation Sequence

Day - 10 (Recursion and Backtracking)

Sn. Problems
1. All permutations of the string
2. N Queen Problem
3. Valid sudoku
4. M Coloring Problem
5. Rat In a Maze
6. Word Break
Sn. Problem
1. The N-th root of an integer
2. Matrix Median
3. Single Element in a Sorted Array
4. Search in Rotated Sorted Array
5. Median of 2 sorted arrays
6. K-th element of two sorted arrays
7. Allocate Minimum Number of Pages
8. Aggressive Cows

Day - 12 (Heap)

Sn. Problem
1. Heap Implementation (Only for interviews)
2. Kth Largest Element
3. K Maximum Sum Combination
4. Find Median from Data-Stream
5. Merge K sorted arrays
6. K most frequent elements

Day - 13 (Stack & Queue - I)

Sn. Problem
1. Implement Stack Using Arrays
2. Implement Queue Using Arrays
3. Implement Stack using Queue
4. Implement Queue using Stack
5. Check for balanced parentheses
6. Next Greater Element
7. Sort a Stack

Day - 14 (Stack & Queue - II)

Sn. Problem
1. Next Smaller Element
2. LRU cache (IMPORTANT)
3. LFU Cache
4. Largest rectangle in a histogram
5. Sliding Window maximum
6. Implement Min Stack
7. Rotten Orange (Using BFS)
8. Stock Span Problem
9. maximum of minimums of every window size
10. The Celebrity Problem

Day - 15 (String I)

Sn. Problem
1. Reverse Words in a String
2. Longest Palindromic Substring
3. Roman Number to Integer and vice versa
4. Implement ATOI/STRSTR
5. Longest Common Prefix
6. Rabin Karp

Day - 16 (String II)

Sn. Problem
1. Z-Function
2. KMP algo / LPS(pi) array
3. Minimum Characters For Palindrome
4. Check for Anagrams
5. Count and Say
6. Compare version numbers

Day - 17 (Binary Tree)

Sn. Problem
1. Inorder Traversal
2. Preorder Traversal
3. Postorder Traversal
4. LeftView Of Binary Tree
5. Bottom View of Binary Tree
6. Top View of Binary Tree
7. Preorder inorder postorder in a single traversal
8. Vertical order traversal
9. Root to node path in a Binary Tree
10. Max width of a Binary Tree

Day - 18 (Binary Tree - 2)

Sn. Problem
1. Level order traversal
2. Height of a Binary Tree
3. Diameter of Binary Tree
4. Check if the Binary tree is height-balanced or not
5. LCA in Binary Tree
6. Check if two trees are identical or not
7. Zig Zag Traversal of Binary Tree
8. Boundary Traversal of Binary Tree

Day - 19 (Binary Tree - 3)

Sn. Problem
1. Maximum path sum
2. Construct Binary Tree from inorder and Preorder
3. Construct Binary Tree from Inorder and Postorder
4. Symmetric Binary Tree
5. Flatten Binary Tree to LinkedList
6. Check if Binary Tree is the mirror of itself or not
7. Check for Children Sum Property