├── Day 1 ├── Find the duplicate in an array of N+1 integers.py ├── Kadane’s Algorithm.py ├── Merge Overlapping Subintervals.py ├── Merge two sorted Arrays without extra space.py ├── Repeat and Missing Number.py └── Sort an array of 0’s 1’s 2’s without using extra space or sorting algo.py ├── Day 2 ├── Inversion of Array.py ├── Next Permutation.py ├── Pascal Triangle.py ├── Rotate Matrix.py ├── Set Matrix Zeros.py └── Stock Buy and Sell.py ├── Day 3 ├── Grid Unique Paths.py ├── Majority Element N2.py ├── Majority Element N3.py ├── Pow(X,n).py ├── Reverse Pairs (Leetcode).py └── Search in a 2D matrix.py ├── Day 4 ├── 2 Sum problem.py ├── 4 Sum problem.py ├── Count number of subarrays with given XOR.py ├── Largest Subarray with 0 sum.py ├── Longest Consecutive Sequence.py └── Longest substring without repeat.py ├── Day 5 ├── Add two numbers as LinkedList.py ├── Delete a given Node when a node is given.py ├── Find middle of LinkedList.py ├── Merge two sorted Linked List.py ├── Remove N-th node from back of LinkedList.py └── Reverse a LinkedList.py ├── Day 6 ├── Check if a LinkedList is palindrome or not.py ├── Detect a cycle in Linked List.py ├── Find intersection point of Y LinkedList.py ├── Find the starting point of the Loop of LinkedList.py ├── Flattening of a LinkedList.py ├── Reverse a LinkedList in groups of size k.py └── Rotate a LinkedList.py ├── Day 7 ├── 3 sum.py ├── Clone a Linked List with random and next pointer.py ├── Max consecutive ones.py ├── Remove Duplicate from Sorted array.py └── Trapping rainwater.py ├── Day 8 ├── Activity Selection (it is same as N meeting in one room).py ├── Fractional Knapsack Problem.py ├── Greedy algorithm to find minimum number of coins.py ├── Job sequencing Problem.py ├── Minimum number of platforms required for a railway.py └── N meeting in one room.py ├── Day 9 ├── Combination sum-1.py ├── Combination sum-2.py ├── K-th permutation Sequence.py ├── Palindrome Partitioning.py ├── Subset Sums.py └── Subset-II.py ├── Day10 ├── M coloring Problem.py ├── N queens Problem.py ├── Print all Permutations of a array.py ├── Rat in a Maze.py ├── Sudoku Solver.py └── Word Break (print all ways) .py ├── Day11 ├── Aggressive Cows.py ├── Allocate Minimum Number of Pages.py ├── Find the element that appears once in sorted array, and rest element appears twice (Binary search).py ├── K-th element of two sorted arrays.py ├── Matrix Median.py ├── Median of 2 sorted arrays.py ├── N-th root of an integer (use binary search) (square root, cube root, ..).py └── Search element in a sorted and rotated array find pivot where it is rotated.py ├── Day12 ├── Check if a number if a power of 2 or not in O(1).py ├── Count total set bits.py ├── Divide Integers without operator.py ├── Find MSB in o(1).py ├── Find square of a number without using multiplication or division operators.py └── Power Set (this is very important).py ├── Day13 ├── Check for balanced parentheses.py ├── Implement Queue Using Arrays.py ├── Implement Queue using Stack (0(1) amortised method).py ├── Implement Stack Using Arrays.py ├── Implement Stack using Queue (using single queue).py └── Next Greater Element.py ├── Day14 ├── Implement Min Stack.py ├── LRU cache (vvvv. imp).py ├── Largest rectangle in histogram.py ├── Next Smaller Element.py ├── Rotten Orange (Using BFS).py └── Sliding Window maximum.py ├── Day15 ├── Implement ATOI or STRSTR.py ├── Longest Common Prefix.py ├── Longest Palindrome in a string.py ├── Rabin Karp.py ├── Reverse Words in a String.py └── Roman Number to Integer and vice versa.py ├── Day16 ├── Check for Anagrams.py ├── Compare version numbers.py ├── Count and Say.py ├── KMP algo.py ├── Minimum characters needed to be inserted in the beginning to make it palindromic.py └── Prefix Function or Z-Function.py ├── Day17 ├── Bottom View of Binary Tree.py ├── Inorder Traversal (with recursion and without recursion).py ├── LeftView Of Binary Tree.py ├── Postorder Traversal (with recursion and without recursion).py ├── Preorder Traversal (with recursion and without recursion).py └── Top View of Binary Tree.py ├── Day18 ├── Check if Binary tree is height balanced or not.py ├── Check if two trees are identical or not.py ├── Diameter of Binary Tree.py ├── Height of a Binary Tree.py ├── LCA in Binary Tree.py └── Level order Traversal or Level order traversal in spiral form.py ├── Day19 ├── Check if Binary Tree is mirror of itself or not.py ├── Construct Binary Tree from Inorder and Postorder.py ├── Construct Binary Tree from inorder and preorder.py ├── Flatten Binary Tree to LinkedList.py ├── Maximum path sum.py └── Symmetric Binary Tree.py ├── Day20 ├── Check is a BT is BST or not.py ├── Construct BST from given keys.py ├── Find LCA of two nodes in BST.py ├── Find the inorder predecessor or successor of a given Key in BST.py ├── Populate Next Right pointers of Tree.py └── Search given Key in BST.py ├── Day21 ├── BST iterator.py ├── Find K-th smallest and K-th largest element in BST (2 different Questions).py ├── Find a pair with a given sum in BST.py ├── Floor and Ceil in a BST.py ├── Serialize and deserialize Binary Tree.py └── Size of the largest BST in a Binary Tree.py ├── Day22 ├── Binary Tree to Double Linked List.py ├── Distinct numbers in Window.py ├── Find median in a stream of running integers.py ├── Flood-fill Algorithm.py ├── K-th largest element in a stream.py └── K-th largest element in an unsorted array.py ├── Day23 ├── BFS.py ├── Bipartite Check.py ├── Clone a graph (Not that easy as it looks).py ├── DFS.py ├── Detect A cycle in Undirected Graph or Directed Graph.py ├── Number of islands (Do in Grid and Graph both).py └── Topo Sort.py ├── Day24 ├── Bellman Ford Algo.py ├── Djisktra’s Algorithm.py ├── Floyd Warshall Algorithm.py ├── MST using Kruskal’s Algo.py ├── MST using Prim’s Algo.py └── SCC(using KosaRaju’s algo).py ├── Day25 ├── 0-1 Knapsack.py ├── Edit Distance.py ├── Longest Common Subsequence.py ├── Longest Increasing Subsequence.py ├── Matrix Chain Multiplication.py ├── Max Product Subarray.py └── Maximum sum increasing subsequence.py ├── Day26 ├── Coin change.py ├── Egg Dropping.py ├── Maximum profit in Job scheduling.py ├── Maximum sum path in matrix, (count paths, and similar type do, also backtrack to find the maximum path).py ├── Palindrome Partitioning (MCM Variation).py ├── Rod Cutting.py ├── Subset Sum.py └── Word Break.py └── README.md /Day 1/Find the duplicate in an array of N+1 integers.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 1/Find the duplicate in an array of N+1 integers.py -------------------------------------------------------------------------------- /Day 1/Kadane’s Algorithm.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 1/Kadane’s Algorithm.py -------------------------------------------------------------------------------- /Day 1/Merge Overlapping Subintervals.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 1/Merge Overlapping Subintervals.py -------------------------------------------------------------------------------- /Day 1/Merge two sorted Arrays without extra space.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 1/Merge two sorted Arrays without extra space.py -------------------------------------------------------------------------------- /Day 1/Repeat and Missing Number.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 1/Repeat and Missing Number.py -------------------------------------------------------------------------------- /Day 1/Sort an array of 0’s 1’s 2’s without using extra space or sorting algo.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 1/Sort an array of 0’s 1’s 2’s without using extra space or sorting algo.py -------------------------------------------------------------------------------- /Day 2/Inversion of Array.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 2/Inversion of Array.py -------------------------------------------------------------------------------- /Day 2/Next Permutation.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 2/Next Permutation.py -------------------------------------------------------------------------------- /Day 2/Pascal Triangle.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 2/Pascal Triangle.py -------------------------------------------------------------------------------- /Day 2/Rotate Matrix.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 2/Rotate Matrix.py -------------------------------------------------------------------------------- /Day 2/Set Matrix Zeros.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 2/Set Matrix Zeros.py -------------------------------------------------------------------------------- /Day 2/Stock Buy and Sell.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 2/Stock Buy and Sell.py -------------------------------------------------------------------------------- /Day 3/Grid Unique Paths.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 3/Grid Unique Paths.py -------------------------------------------------------------------------------- /Day 3/Majority Element N2.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 3/Majority Element N2.py -------------------------------------------------------------------------------- /Day 3/Majority Element N3.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 3/Majority Element N3.py -------------------------------------------------------------------------------- /Day 3/Pow(X,n).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 3/Pow(X,n).py -------------------------------------------------------------------------------- /Day 3/Reverse Pairs (Leetcode).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 3/Reverse Pairs (Leetcode).py -------------------------------------------------------------------------------- /Day 3/Search in a 2D matrix.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 3/Search in a 2D matrix.py -------------------------------------------------------------------------------- /Day 4/2 Sum problem.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 4/2 Sum problem.py -------------------------------------------------------------------------------- /Day 4/4 Sum problem.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 4/4 Sum problem.py -------------------------------------------------------------------------------- /Day 4/Count number of subarrays with given XOR.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 4/Count number of subarrays with given XOR.py -------------------------------------------------------------------------------- /Day 4/Largest Subarray with 0 sum.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 4/Largest Subarray with 0 sum.py -------------------------------------------------------------------------------- /Day 4/Longest Consecutive Sequence.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 4/Longest Consecutive Sequence.py -------------------------------------------------------------------------------- /Day 4/Longest substring without repeat.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 4/Longest substring without repeat.py -------------------------------------------------------------------------------- /Day 5/Add two numbers as LinkedList.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 5/Add two numbers as LinkedList.py -------------------------------------------------------------------------------- /Day 5/Delete a given Node when a node is given.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 5/Delete a given Node when a node is given.py -------------------------------------------------------------------------------- /Day 5/Find middle of LinkedList.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 5/Find middle of LinkedList.py -------------------------------------------------------------------------------- /Day 5/Merge two sorted Linked List.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 5/Merge two sorted Linked List.py -------------------------------------------------------------------------------- /Day 5/Remove N-th node from back of LinkedList.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 5/Remove N-th node from back of LinkedList.py -------------------------------------------------------------------------------- /Day 5/Reverse a LinkedList.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 5/Reverse a LinkedList.py -------------------------------------------------------------------------------- /Day 6/Check if a LinkedList is palindrome or not.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 6/Check if a LinkedList is palindrome or not.py -------------------------------------------------------------------------------- /Day 6/Detect a cycle in Linked List.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 6/Detect a cycle in Linked List.py -------------------------------------------------------------------------------- /Day 6/Find intersection point of Y LinkedList.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 6/Find intersection point of Y LinkedList.py -------------------------------------------------------------------------------- /Day 6/Find the starting point of the Loop of LinkedList.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 6/Find the starting point of the Loop of LinkedList.py -------------------------------------------------------------------------------- /Day 6/Flattening of a LinkedList.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 6/Flattening of a LinkedList.py -------------------------------------------------------------------------------- /Day 6/Reverse a LinkedList in groups of size k.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 6/Reverse a LinkedList in groups of size k.py -------------------------------------------------------------------------------- /Day 6/Rotate a LinkedList.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 6/Rotate a LinkedList.py -------------------------------------------------------------------------------- /Day 7/3 sum.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 7/3 sum.py -------------------------------------------------------------------------------- /Day 7/Clone a Linked List with random and next pointer.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 7/Clone a Linked List with random and next pointer.py -------------------------------------------------------------------------------- /Day 7/Max consecutive ones.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 7/Max consecutive ones.py -------------------------------------------------------------------------------- /Day 7/Remove Duplicate from Sorted array.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 7/Remove Duplicate from Sorted array.py -------------------------------------------------------------------------------- /Day 7/Trapping rainwater.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 7/Trapping rainwater.py -------------------------------------------------------------------------------- /Day 8/Activity Selection (it is same as N meeting in one room).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 8/Activity Selection (it is same as N meeting in one room).py -------------------------------------------------------------------------------- /Day 8/Fractional Knapsack Problem.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 8/Fractional Knapsack Problem.py -------------------------------------------------------------------------------- /Day 8/Greedy algorithm to find minimum number of coins.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 8/Greedy algorithm to find minimum number of coins.py -------------------------------------------------------------------------------- /Day 8/Job sequencing Problem.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 8/Job sequencing Problem.py -------------------------------------------------------------------------------- /Day 8/Minimum number of platforms required for a railway.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 8/Minimum number of platforms required for a railway.py -------------------------------------------------------------------------------- /Day 8/N meeting in one room.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 8/N meeting in one room.py -------------------------------------------------------------------------------- /Day 9/Combination sum-1.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 9/Combination sum-1.py -------------------------------------------------------------------------------- /Day 9/Combination sum-2.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 9/Combination sum-2.py -------------------------------------------------------------------------------- /Day 9/K-th permutation Sequence.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 9/K-th permutation Sequence.py -------------------------------------------------------------------------------- /Day 9/Palindrome Partitioning.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 9/Palindrome Partitioning.py -------------------------------------------------------------------------------- /Day 9/Subset Sums.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 9/Subset Sums.py -------------------------------------------------------------------------------- /Day 9/Subset-II.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day 9/Subset-II.py -------------------------------------------------------------------------------- /Day10/M coloring Problem.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day10/N queens Problem.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day10/Print all Permutations of a array.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day10/Print all Permutations of a array.py -------------------------------------------------------------------------------- /Day10/Rat in a Maze.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day10/Sudoku Solver.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day10/Word Break (print all ways) .py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day11/Aggressive Cows.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day11/Allocate Minimum Number of Pages.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day11/Find the element that appears once in sorted array, and rest element appears twice (Binary search).py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day11/K-th element of two sorted arrays.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day11/Matrix Median.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day11/Matrix Median.py -------------------------------------------------------------------------------- /Day11/Median of 2 sorted arrays.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day11/N-th root of an integer (use binary search) (square root, cube root, ..).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day11/N-th root of an integer (use binary search) (square root, cube root, ..).py -------------------------------------------------------------------------------- /Day11/Search element in a sorted and rotated array find pivot where it is rotated.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day12/Check if a number if a power of 2 or not in O(1).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day12/Check if a number if a power of 2 or not in O(1).py -------------------------------------------------------------------------------- /Day12/Count total set bits.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day12/Count total set bits.py -------------------------------------------------------------------------------- /Day12/Divide Integers without operator.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day12/Divide Integers without operator.py -------------------------------------------------------------------------------- /Day12/Find MSB in o(1).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day12/Find MSB in o(1).py -------------------------------------------------------------------------------- /Day12/Find square of a number without using multiplication or division operators.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day12/Find square of a number without using multiplication or division operators.py -------------------------------------------------------------------------------- /Day12/Power Set (this is very important).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day12/Power Set (this is very important).py -------------------------------------------------------------------------------- /Day13/Check for balanced parentheses.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day13/Implement Queue Using Arrays.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day13/Implement Queue using Stack (0(1) amortised method).py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day13/Implement Stack Using Arrays.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day13/Implement Stack using Queue (using single queue).py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day13/Next Greater Element.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day14/Implement Min Stack.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day14/LRU cache (vvvv. imp).py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day14/Largest rectangle in histogram.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day14/Next Smaller Element.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day14/Rotten Orange (Using BFS).py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day14/Sliding Window maximum.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day15/Implement ATOI or STRSTR.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day15/Longest Common Prefix.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day15/Longest Common Prefix.py -------------------------------------------------------------------------------- /Day15/Longest Palindrome in a string.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day15/Longest Palindrome in a string.py -------------------------------------------------------------------------------- /Day15/Rabin Karp.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day15/Rabin Karp.py -------------------------------------------------------------------------------- /Day15/Reverse Words in a String.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day15/Reverse Words in a String.py -------------------------------------------------------------------------------- /Day15/Roman Number to Integer and vice versa.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day16/Check for Anagrams.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day16/Check for Anagrams.py -------------------------------------------------------------------------------- /Day16/Compare version numbers.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day16/Count and Say.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day16/KMP algo.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day16/Minimum characters needed to be inserted in the beginning to make it palindromic.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day16/Prefix Function or Z-Function.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day17/Bottom View of Binary Tree.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day17/Bottom View of Binary Tree.py -------------------------------------------------------------------------------- /Day17/Inorder Traversal (with recursion and without recursion).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day17/Inorder Traversal (with recursion and without recursion).py -------------------------------------------------------------------------------- /Day17/LeftView Of Binary Tree.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day17/LeftView Of Binary Tree.py -------------------------------------------------------------------------------- /Day17/Postorder Traversal (with recursion and without recursion).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day17/Postorder Traversal (with recursion and without recursion).py -------------------------------------------------------------------------------- /Day17/Preorder Traversal (with recursion and without recursion).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day17/Preorder Traversal (with recursion and without recursion).py -------------------------------------------------------------------------------- /Day17/Top View of Binary Tree.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day17/Top View of Binary Tree.py -------------------------------------------------------------------------------- /Day18/Check if Binary tree is height balanced or not.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day18/Check if Binary tree is height balanced or not.py -------------------------------------------------------------------------------- /Day18/Check if two trees are identical or not.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day18/Check if two trees are identical or not.py -------------------------------------------------------------------------------- /Day18/Diameter of Binary Tree.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day18/Diameter of Binary Tree.py -------------------------------------------------------------------------------- /Day18/Height of a Binary Tree.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day18/Height of a Binary Tree.py -------------------------------------------------------------------------------- /Day18/LCA in Binary Tree.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day18/LCA in Binary Tree.py -------------------------------------------------------------------------------- /Day18/Level order Traversal or Level order traversal in spiral form.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day18/Level order Traversal or Level order traversal in spiral form.py -------------------------------------------------------------------------------- /Day19/Check if Binary Tree is mirror of itself or not.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day19/Check if Binary Tree is mirror of itself or not.py -------------------------------------------------------------------------------- /Day19/Construct Binary Tree from Inorder and Postorder.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day19/Construct Binary Tree from Inorder and Postorder.py -------------------------------------------------------------------------------- /Day19/Construct Binary Tree from inorder and preorder.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day19/Construct Binary Tree from inorder and preorder.py -------------------------------------------------------------------------------- /Day19/Flatten Binary Tree to LinkedList.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day19/Flatten Binary Tree to LinkedList.py -------------------------------------------------------------------------------- /Day19/Maximum path sum.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day19/Maximum path sum.py -------------------------------------------------------------------------------- /Day19/Symmetric Binary Tree.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day19/Symmetric Binary Tree.py -------------------------------------------------------------------------------- /Day20/Check is a BT is BST or not.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day20/Check is a BT is BST or not.py -------------------------------------------------------------------------------- /Day20/Construct BST from given keys.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day20/Find LCA of two nodes in BST.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day20/Find LCA of two nodes in BST.py -------------------------------------------------------------------------------- /Day20/Find the inorder predecessor or successor of a given Key in BST.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day20/Populate Next Right pointers of Tree.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day20/Search given Key in BST.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day20/Search given Key in BST.py -------------------------------------------------------------------------------- /Day21/BST iterator.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day21/Find K-th smallest and K-th largest element in BST (2 different Questions).py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day21/Find a pair with a given sum in BST.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day21/Floor and Ceil in a BST.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day21/Serialize and deserialize Binary Tree.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day21/Size of the largest BST in a Binary Tree.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day22/Binary Tree to Double Linked List.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day22/Distinct numbers in Window.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day22/Find median in a stream of running integers.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day22/Flood-fill Algorithm.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day22/K-th largest element in a stream.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day22/K-th largest element in an unsorted array.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day23/BFS.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day23/BFS.py -------------------------------------------------------------------------------- /Day23/Bipartite Check.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day23/Clone a graph (Not that easy as it looks).py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day23/DFS.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day23/DFS.py -------------------------------------------------------------------------------- /Day23/Detect A cycle in Undirected Graph or Directed Graph.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day23/Number of islands (Do in Grid and Graph both).py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day23/Topo Sort.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day24/Bellman Ford Algo.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day24/Djisktra’s Algorithm.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day24/Floyd Warshall Algorithm.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day24/MST using Kruskal’s Algo.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day24/MST using Prim’s Algo.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day24/SCC(using KosaRaju’s algo).py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day25/0-1 Knapsack.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day25/0-1 Knapsack.py -------------------------------------------------------------------------------- /Day25/Edit Distance.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day25/Edit Distance.py -------------------------------------------------------------------------------- /Day25/Longest Common Subsequence.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day25/Longest Common Subsequence.py -------------------------------------------------------------------------------- /Day25/Longest Increasing Subsequence.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day25/Longest Increasing Subsequence.py -------------------------------------------------------------------------------- /Day25/Matrix Chain Multiplication.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day25/Max Product Subarray.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day25/Max Product Subarray.py -------------------------------------------------------------------------------- /Day25/Maximum sum increasing subsequence.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day25/Maximum sum increasing subsequence.py -------------------------------------------------------------------------------- /Day26/Coin change.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day26/Coin change.py -------------------------------------------------------------------------------- /Day26/Egg Dropping.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day26/Egg Dropping.py -------------------------------------------------------------------------------- /Day26/Maximum profit in Job scheduling.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day26/Maximum sum path in matrix, (count paths, and similar type do, also backtrack to find the maximum path).py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day26/Maximum sum path in matrix, (count paths, and similar type do, also backtrack to find the maximum path).py -------------------------------------------------------------------------------- /Day26/Palindrome Partitioning (MCM Variation).py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Day26/Rod Cutting.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day26/Rod Cutting.py -------------------------------------------------------------------------------- /Day26/Subset Sum.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/Day26/Subset Sum.py -------------------------------------------------------------------------------- /Day26/Word Break.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Shwetank2101/STRIVER-SDE-SHEET/HEAD/README.md --------------------------------------------------------------------------------