Striver's SDE Sheet

Dhiraj
0


 Day-1

Q.NoProblem NameDetailed SolutionProblem LinkVideo SolutionC++ CodeJava Code
1Set Matrix ZerosSolutionClickYoutubeCodeCode
2Pascal TriangleSolutionClickYouTubeCodeCode
3.Next PermutationSolutionClickYouTubeCodeCode
4.Kadane’s AlgorithmSolutionClickYouTubeCodeCode
5.Sort an array of 0’s 1’s 2’sSolutionClickYouTubeCodeCode
6.Stock Buy and Sell SolutionClickYouTubeCodeCode

Day-2

Q.NoProblem NameDetailed SolutionProblem LinkVideo SolutionC++ CodeJava Code
1Rotate Matrix  SolutionClickYoutubeCodeCode
2Merge Overlapping SubintervalsSolutionClickYouTubeCodeCode
3.Merge two sorted Arrays without
extra space
SolutionClickYouTubeCodeCode
4.Find the duplicate in an array
of N+1 integers.
SolutionClickYouTubeCodeCode
5.Repeat and Missing NumberSolutionClickYouTubeCodeCode
6.Inversion of Array (Pre-req: Merge Sort)SolutionClickYouTubeCodeCode

Day-3

Q.NoProblem NameDetailed SolutionProblem LinkVideo SolutionC++ CodeJava Code
1Search in a 2d MatrixSolutionClickYoutubeCodeCode
2Pow(X,n)SolutionClickYouTubeCodeCode
3.Majority Element (>N/2 times)  SolutionClickYouTubeCodeCode
4.Majority Element (>N/3 times)SolutionClickYouTubeCodeCode
5.Grid Unique PathsSolutionClickYouTubeCodeCode
6.Reverse Pairs (Leetcode)SolutionClickYouTubeCodeCode

Day-4

Q.NoProblem NameDetailed SolutionProblem LinkVideo SolutionC++ CodeJava Code
12-Sum-ProblemSolutionClickYoutubeCodeCode
24-sum-ProblemSolutionClickYouTubeCodeCode
3.Longest Consecutive SequenceSolutionClickYouTubeCodeCode
4.Largest Subarray with 0 sumSolutionClickYouTubeCodeCode
5.Count number of subarrays with
given Xor K
SolutionClickYouTubeCodeCode
6.Longest Substring without repeat  SolutionClickYouTubeCodeCode

Day-5: Linked List

Q.NoProblem NameDetailed SolutionProblem LinkVideo SolutionC++ CodeJava Code
1Reverse a LinkedListSolutionClickYoutubeCodeCode
2Find the middle of LinkedListSolutionClickYouTubeCodeCode
3.Merge two sorted Linked List
(use method used in mergeSort)
SolutionClickYouTubeCodeCode
4.Remove N-th node from back of
LinkedList
SolutionClickYouTubeCodeCode
5.Add two numbers as LinkedListSolutionClickYouTubeCodeCode
6.Delete a given Node when a node
is given.
(0(1) solution)
SolutionClickYouTubeCodeCode

Day-6

Q.NoProblem NameDetailed SolutionProblem LinkVideo SolutionC++ CodeJava Code
1Find intersection point
of Y LinkedList
SolutionClickYoutubeCodeCode
2Detect a cycle in Linked ListClickYouTubeCodeCode
3.Reverse a LinkedList in
groups of size k. 
ClickYouTubeCodeCode
4.Check if a LinkedList is
palindrome or not.
ClickYouTubeCodeCode
5.Find the starting point
of the Loop of LinkedList
ClickYouTubeCodeCode
6.Flattening of a LinkedListClickYouTubeCodeCode
7.Rotate a LinkedListClickYouTubeCodeCode

Day-7

Q.NoProblem NameDetailed SolutionProblem LinkVideo SolutionC++ CodeJava Code
1Clone a Linked List with
random and next pointer
ClickYoutubeCodeCode
23 sumSolutionClickYouTubeCodeCode
3.Trapping rainwaterSolutionClickYouTubeCodeCode
4.Remove Duplicate from Sorted arraySolutionClickYouTubeCodeCode
5.Max consecutive onesSolutionClickYouTubeCodeCode

Day-8

Q.NoProblem NameDetailed SolutionProblem LinkVideo SolutionC++ CodeJava Code
1N meeting in one roomSolutionClickYoutubeCodeCode
2Minimum number of platforms
required for a railway
SolutionClickYouTubeCodeCode
3.Job sequencing Problem SolutionClickYouTubeCodeCode
4.Fractional Knapsack ProblemSolutionClickYouTubeCodeCode
5.Greedy algorithm to find
minimum number of coins
SolutionClickYouTubeCodeCode
6.Activity Selection
(it is the same as N meeting in one room)
SolutionClickYoutubeCodeCode

Day-9Recursion

Q.NoProblem NameDetailed SolutionProblem LinkVideo SolutionC++ CodeJava Code
1Subset SumsSolutionClickYoutubeCodeCode
2Subset-II SolutionClickYouTubeCodeCode
3.Combination sum-1SolutionClickYouTubeCodeCode
4.Combination sum-2 ClickYouTubeCodeCode
5.Palindrome PartitioningSolutionClickYouTubeCodeCode
6.K-th permutation SequenceSolutionClickYouTubeCodeCode

Day-10 : Recursion & Backtracking

Q.NoProblem NameDetailed SolutionProblem LinkVideo SolutionC++ CodeJava Code
1Print all permutations of a string/arraySolutionClickYoutubeCodeCode
2N queens ProblemSolutionClickYoutubeCodeCode
3.Sudoku SolverClickYoutubeCodeCode
4.M coloring ProblemSolutionClickYoutubeCodeCode
5.Rat in a MazeSolutionClickYoutubeCodeCode
6.Word Break (print all ways)ClickYoutubeCodeCode

Day-11: Binary Search

Q.NoProblem NameDetailed SolutionProblem LinkVideo SolutionC++ CodeJava Code
1The N-th root of an integerSolutionClickYoutubeCodeCode
2Matrix MedianClickYoutubeCodeCode
3.Find the element that appears once in a sorted array, and the rest element appears twice (Binary search) SolutionClickYoutubeCodeCode
4.Search element in a sorted and rotated array/ find pivot where it is rotated SolutionClickYoutubeCodeCode
5.Median of 2 sorted arraysSolutionClickYoutubeCodeCode
6.K-th element of two sorted arrays SolutionClickYoutubeCodeCode
7.Allocate Minimum Number of PagesSolutionClickYoutubeCodeCode
8.Aggressive CowsSolutionClickYoutubeCodeCode

Day-12TRIES (Can be done at Last, but still a very very important topic) Watch this playlist -> Link

Q.NoProblem NameDetailed SolutionProblem LinkVideo SolutionC++ CodeJava Code
1Implement Trie (Prefix Tree)ClickYoutubeCodeCode
2Implement Trie – 2 (Prefix Tree)ClickYoutubeCodeCode
3.Longest String with All PrefixesClickYoutubeCodeCode
4.Number of Distinct Substrings in a StringClickYoutubeCodeCode
4.Power Set (this is very important) ClickYoutubeCodeCode
5.Maximum XOR of two numbers in an arraySolutionClickYoutubeCodeCode
6.Maximum XOR With an Element From ArrayClickYoutubeCodeCode

Day-13 : (Stack and Queue) 

Q.NoProblem NameSolutionProblem LinkVideo SolutionC++ CodeJava Code
1Implement Stack Using ArraysSolutionClickYoutubeCodeCode
2Implement Queue Using ArraysSolutionClickYoutubeCodeCode
3.Implement Stack using Queue (using single queue)SolutionClickYoutubeCodeCode
4.Implement Queue using Stack (0(1) amortized method)SolutionClickYoutubeCodeCode
5.Check for balanced parenthesesSolutionClickYoutubeCodeCode
6.Next Greater Element SolutionClickYoutubeCodeCode
7.Sort a Stack ClickYoutubeCodeCode

Day-14 :

Q.NoProblem NameDetailed SolutionProblem LinkVideo SolutionC++ CodeJava Code
1Next Smaller ElementClickYoutubeCodeCode
2LRU cache (IMPORTANT) SolutionClickYoutubeCodeCode
3.LFU CacheClickYoutubeCodeCode
4.Largest rectangle in a histogramSolutionClickTwo-Pass: Youtube

One Pass: Youtube
CodeCode
5.Sliding Window maximumSolutionClickYoutubeCodeCode
6.Implement Min Stack  SolutionClickYoutubeCodeCode
7.Rotten Orange (Using BFS)SolutionClick
8.Stock Span Problem Click
9.Find the maximum of minimums of every window sizeClick
10.The Celebrity Problem Click

Day-15String

Q.NoProblem NameDetailed SolutionProblem LinkVideo SolutionC++ CodeJava Code
1Reverse Words in a String SolutionClickYoutubeCodeCode
2Longest Palindrome in a stringClickYoutubeCodeCode
3.Roman Number to Integer and vice versaClickYoutubeCodeCode
4.Implement ATOI/STRSTR ClickYoutubeCodeCode
5.Longest Common PrefixClickYoutubeCodeCode
6.Rabin Karp ClickYoutubeCodeCode

Day-16String [Continued]

Q.NoProblem NameProblem LinkVideo SolutionC++ CodeJava Code
1Z-FunctionClickYoutubeCodeCode
2KMP algo / LPS(pi) arrayClickYouTubeCodeCode
3.Minimum characters needed
to be inserted in the beginning
to make it palindromic
ClickYouTubeCodeCode
4.Check for AnagramsClickYouTubeCodeCode
5.Count and SayClickYouTubeCodeCode
6.Compare version numbersClickYouTubeCodeCode

Day-17Binary Tree (Introduction)

Q.NoProblem NameDetailed SolutionProblem LinkVideo SolutionC++ CodeJava Code
1Inorder TraversalMorris Traversal

Iterative/Recursive
ClickYoutube (Recursive)
Youtube (Iterative)
Youtube (Morris Traversal)
Code (Recursive)
Code (Iterative)
Code (Recursive)
Code (Iterative)
Code (Morris)
2Preorder TraversalMorris Traversal

Solution
ClickYouTube
Youtube (Morris Traversal)
Code (Morris)Code
3.Postorder TraversalSolutionClickYouTubeCodeCode
4.LeftView Of Binary TreeSolutionClickYouTubeCodeCode
5.Bottom View of Binary TreeSolutionClickYouTubeCodeCode
6.Top View of Binary Tree SolutionClickYouTubeCodeCode
7.Preorder inorder postorder in a single traversalSolutionYoutubeCodeCode
8.Vertical order traversalSolutionClickYoutubeCodeCode
9.Root to node path in a Binary TreeSolutionClickYoutubeCodeCode
10.Max width of a Binary TreeSolutionClickYoutubeCodeCode

Day-18Binary Tree [Continued]

Q.NoProblem NameDetailed SolutionProblem LinkVideo SolutionC++ CodeJava Code
1Level order Traversal / Level order traversal in spiral formSolutionClickYoutubeCodeCode
2Height of a Binary Tree SolutionClickYouTubeCodeCode
3.Diameter of Binary TreeSolutionClickYouTubeCodeCode
4.Check if the Binary tree is height-balanced or notSolutionClickYouTubeCodeCode
5.LCA in Binary TreeSolutionClickYouTubeCodeCode
6.Check if two trees are identical or notSolutionClickYouTubeCodeCode
7.Zig Zag Traversal of Binary TreeSolutionClickYoutubeCodeCode
8.Boundary Traversal of Binary TreeSolutionClickYoutubeCodeCode

Day-19Binary Tree [Continued]

Q.NoProblem NameDetailed SolutionProblem LinkVideo SolutionC++ CodeJava Code
1Maximum path sumSolutionClickYoutubeCodeCode
2Construct Binary Tree from inorder and preorder ClickYouTubeCodeCode
3.Construct Binary Tree from Inorder and PostorderClickYouTubeCodeCode
4.Symmetric Binary TreeSolutionClickYouTubeCodeCode
5.Flatten Binary Tree to LinkedList SolutionClickYouTubeCodeCode
6.Check if Binary Tree is the mirror of itself or notClickYouTubeCodeCode
7.Check for Children Sum PropertySolution

Day-20Binary Search Tree

Q.NoProblem NameProblem LinkVideo SolutionC++ CodeJava Code
1Populate Next Right pointers of TreeClickYoutubeCodeCode
2Search given Key in BSTClickYouTubeCodeCode
3.Construct BST from given keysClickYouTubeCodeCode
4.Construct BST from preorder traversalClickYoutubeCodeCode
5.Check is a BT is BST or not ClickYouTubeCodeCode
6.Find LCA of two nodes in BSTClickYouTubeCodeCode
7.Find the inorder predecessor/successor of a given Key in BST. ClickYouTubeCodeCode

Day-21Binary Search Tree [Continued]

Q.NoProblem NameDetailed SolutionProblem LinkVideo SolutionC++ CodeJava Code
1.Floor in a BSTClickYoutubeCodeCode
2.Ceil in a BSTClickYoutubeCodeCode
3.Find K-th smallest element in BSTSolutionClickYouTubeCodeCode
4.Find K-th largest element in BSTSolutionClickYouTubeCodeCode
5.Find a pair with a given sum in BSTClickYouTubeCodeCode
6.BST iteratorClickYouTubeCodeCode
7.Size of the largest BST in a Binary Tree ClickYouTubeCodeCode
8.Serialize and deserialize Binary TreeSolutionClickYouTubeCodeCode

Day-22Trees [Miscellaneous]

Q.NoProblem NameProblem LinkVideo SolutionC++ CodeJava Code
1Binary Tree to Double Linked List ClickYoutubeCodeCode
2Find median in a stream of running integers.ClickYouTubeCodeCode
3.K-th largest element in a stream.ClickYouTubeCodeCode
4.Distinct numbers in Window. ClickYouTubeCodeCode
5.K-th largest element in an unsorted array. ClickYouTubeCodeCode
6.Flood-fill Algorithm ClickYouTubeCodeCode

Day-23Graphs – Part 1

Q.NoProblem NameDetailed SolutionProblem LinkVideo SolutionC++ CodeJava Code
1Clone a graph (Not that easy as it looks)ClickYoutubeCodeCode
2DFSSolutionClickYouTubeCodeCode
3.BFSSolutionClickYouTubeCodeCode
4.Detect A cycle in Undirected Graph using BFSSolutionClickYouTubeCodeCode
5.Detect A cycle in Undirected Graph using DFSSolutionClickYouTubeCodeCode
6.Detect A cycle in a Directed Graph using DFSSolutionClickYouTubeCodeCode
7.Detect A cycle in a Directed Graph using BFSClickYouTubeCodeCode
8.Topological Sort Sol: BFS

Sol: DFS
ClickDFS: YouTube

BFS: Youtube
CodeCode
9.Number of islands (Do in Grid and Graph both)ClickYouTubeCodeCode
10.Bipartite Check using BFSClickYouTubeCodeCode
11.Bipartite Check using DFSSolutionClickYouTubeCodeCode

Day-24Graphs – Part 2

Q.NoProblem NameDetailed SolutionProblem LinkVideo SolutionC++ CodeJava Code
1Strongly Connected Component(using KosaRaju’s algo) SolutionClickYoutubeCodeCode
2Dijkstra’s Algorithm SolutionClickYouTubeCodeCode
3.Bellman-Ford AlgoSolutionClickYouTubeCodeCode
4.Floyd Warshall AlgorithmClickYouTubeCodeCode
5.MST using Prim’s Algo SolutionClickYouTubeCodeCode
6.MST using Kruskal’s AlgoSolutionClickYouTubeCodeCode

Day-25Dynamic Programming – Part 1

Q.NoProblem NameDetailed SolutionProblem LinkVideo SolutionC++ CodeJava Code
1Max Product SubarraySolutionClickYoutubeCodeCode
2Longest Increasing SubsequenceClickYouTubeCodeCode
3.Longest Common SubsequenceSolutionClickYouTubeCodeCode
4.0-1 Knapsack ClickYouTubeCodeCode
5.Edit DistanceClickYouTubeCodeCode
6.Maximum sum increasing subsequenceClickYouTubeCodeCode
7.Matrix Chain MultiplicationClickYouTubeCodeCode

Day-26Dynamic Programming – Part 2

Q.NoProblem NameProblem LinkVideo SolutionC++ CodeJava Code
1Maximum sum path in the matrix, (count paths and similar type do, also backtrack to find the maximum path) ClickYoutubeCodeCode
2Coin change ClickYouTubeCodeCode
3.Subset SumClickYouTubeCodeCode
4.Rod Cutting ClickYouTubeCodeCode
5.Egg Dropping  ClickYouTubeCodeCode
6.Word BreakClickYouTubeCodeCode
7.Palindrome Partitioning (MCM Variation) ClickYoutubeCodeCode
8.Maximum profit in Job schedulingClickYoutubeCodeCode
Tags

Post a Comment

0Comments
Post a Comment (0)