Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/chetan6780/striver-sde-sheet

Repository containing solution for #SdeSheetChallenge by striver
https://github.com/chetan6780/striver-sde-sheet

codestudio dsa leetcode sde-sheet sdesheetchallenge strivers-sde-sheet

Last synced: about 1 month ago
JSON representation

Repository containing solution for #SdeSheetChallenge by striver

Awesome Lists containing this project

README

        

# Striver-SDE-Sheet

Find complete [SDE-SHEET](https://takeuforward.org/interviews/strivers-sde-sheet-top-coding-interview-problems/) on [TakeUForward](https://takeuforward.org/interviews/strivers-sde-sheet-top-coding-interview-problems/).

### Day-1 (Arrays-I)

| No. | Problem |
| --- | ------------------------------------------------------------- |
| 1. | [Set Matrix Zeros](DAY_1/1_setMatrixZeros.md) |
| 2. | [Pascal Triangle](DAY_1/2_pascalTriangle.md) |
| 3 . | [Next Permutation](DAY_1/3_nextPermutation.md) |
| 4. | [Maximum sum Subarray](DAY_1/4_kadanesAlgorithm.md) |
| 5. | [Sort 0 1 2](DAY_1/5_sort012.md) |
| 6. | [Best Time to Buy and Sell Stock](DAY_1/6_buyAndSellStock.md) |

### Day-2 (Arrays-II)

| No. | Problem |
| --- | -------------------------------------------------------------------- |
| 2. | [Merge intervals](DAY_2/2_mergeIntervals.md) |
| 3. | [Merge two sorted arrays](DAY_2/3_mergeSortedArrays.md) |
| 4. | [Find Duplicate in Array](DAY_2/4_findDuplicateInArray.md) |
| 5. | [Repeating and missing number](DAY_2/5_repeatingAndMissingNumber.md) |
| 6. | [Count Inversions](DAY_2/6_countInversions.md) |

### Day - 3 (Arrays-III)

| No. | Problems |
| --- | ------------------------------------------------------------- |
| 1. | [Search in a 2D matrix](DAY_3/1_searchIn2DMatrix.md) |
| 2. | [Pow(X,n)](DAY_3/2_powXN.md) |
| 3. | [Majority Element (>N/2 times)](DAY_3/3_majorityElementN2.md) |
| 4. | [Majority Element (>N/3 times)](DAY_3/4_majorityElementN3.md) |
| 5. | [Grid Unique Paths](DAY_3/5_gridUniquePath.md) |
| 6. | [Reverse Pairs (Leetcode)](DAY_3/6_reversePairs.md) |

### Day-4 (Hashing)

| No. | Problems |
| --- | ------------------------------------------------------------------------------------ |
| 1. | [2 sum problem](DAY_4/1_2sum.md) |
| 2. | [4 sum problem](DAY_4/2_4sum.md) |
| 3. | [Longest Consecutive Sequence](DAY_4/3_LongestConsecutiveSequence.md) |
| 4. | [Largest Subarray with 0 sum](DAY_4/4_largestSubarrayZeroSum.md) |
| 5. | [Count number of subarrays with given XOR](DAY_4/5_countNoOfSubArrayWithGivenXOR.md) |
| 6. | [Longest substring without repeat](DAY_4/6_longestSubstringWithoutRepeat.md) |

### Day - 5 (Linked List)

| No. | Problems |
| --- | ----------------------------------------------------------------- |
| 1. | [Reverse a LinkedList](DAY_5/1_ReverseLinkedList.md) |
| 2. | [Find middle of linked list](DAY_5/2_findMiddleOfLinkedList.md) |
| 3. | [Merge two sorted linked list](DAY_5/3_mergeTWoSortedLists.md) |
| 4. | [Remove Nth node from back](DAY_5/4_removeNthNodeFromBack.md) |
| 5. | [Delete a Given node O(1)](DAY_5/5_deleteGivenNode.md) |
| 6. | [Add two numbers as linked list](DAY_5/6_addTwoNumbersAsLList.md) |

### Day - 6 (Linked List)

| Sn. | Problems |
| --- | ---------------------------------------------------------------------------------------- |
| 1. | [Find intersection point of Y LinkedList](DAY_6/1_findIntersectionPointOfYLinkedList.md) |
| 2. | [Detect a cycle in Linked List](DAY_6/2_detectCycleInLL.md) |
| 3. | [Reverse a LinkedList in groups of size k.](DAY_6/3_reverseLLinGroupK.md) |
| 4. | [Check if a LinkedList is palindrome or not.](DAY_6/4_isLLPalindrome.md) |
| 5. | [Find the starting point of the Loop of LinkedList](DAY_6/5_startingPointOfLL.md) |
| 6. | [Flattening of a LinkedList](DAY_6/6_flatteningOfLL.md) |

### Day - 7 (2 Pointers)

| Sn. | Problems |
| --- | -------------------------------------------------------------------------------------------- |
| 1. | [Rotate linked list](./DAY_7/1_rotateLL.md) |
| 2. | [Clone Linked List with random and next pointer](DAY_7/2_cloneLLWithRandomAndNextPointer.md) |
| 3. | [3 sum](DAY_7/3_3sum.md) |
| 4. | [Trapping rainwater](DAY_7/4_trappingRainwater.md) |
| 5. | [Remove Duplicate from Sorted array](DAY_7/5_removeDuplicates.md) |
| 6. | [Max consecutive ones](DAY_7/6_maxConsecutiveOnes.md) |

### Day - 8 (Greedy)

| Sn. | Problems |
| --- | ---------------------------------------------------------------------------------- |
| 1. | [N meeting in one room](DAY_8/1_N_meeting_in_one_room.md) |
| 2. | [Minimum number of platforms required for a railway](DAY_8/2_minimum_platforms.md) |
| 3. | [Job sequencing Problem](DAY_8/3_job_sequencing.md) |
| 4. | [Fractional Knapsack Problem](DAY_8/4_fractional_knapsack.md) |
| 5. | [Greedy algorithm to find minimum number of coins](DAY_8/5_minimum_coins.md) |
| 6. | [Activity Selection (it is same as N meeting in one room]() |

### Day - 9 (Recursion)

| Sn. | Problems |
| --- | -------------------------------------------------------------- |
| 1. | [Subset sum](DAY_9/1_subsetSum.md.md) |
| 2. | [Subset sum-II](DAY_9/2_subsetSumII.md) |
| 3. | [Combination sum-1](DAY_9/3_combinationSumI.md) |
| 4. | [Combination sum-2](DAY_9/4_combinationSumII.md) |
| 5. | [Palindrome Partitioning](DAY_9/5_palindromePartitioning.md) |
| 6. | [K-th permutation Sequence](DAY_9/6_kthPermutationSequence.md) |

### Day - 10 (Recursion and Backtracking)

| Sn. | Problems |
| --- | ---------------------------------------------------------- |
| 1. | [All permutations of the string](DAY_10/1_permutations.md) |
| 2. | [N Queen Problem](DAY_10/2_nQueenProblem.md) |
| 3. | [Valid sudoku](DAY_10/3_validSudoku.md) |
| 4. | [M Coloring Problem](DAY_10/4_mColoringProblem.md) |
| 5. | [Rat In a Maze](DAY_10/5_ratInAMaze.md) |
| 6. | [Word Break](DAY_10/6_wordBreak.md) |

### Day - 11 (Binary Search)

| Sn. | Problem |
| --- | ---------------------------------------------------------------------------- |
| 1. | [The N-th root of an integer ](DAY_11/1_nthRootOfM.md) |
| 2. | [Matrix Median ](DAY_11/2_matrixMedian.md) |
| 3. | [Single Element in a Sorted Array ](DAY_11/3_singleElementInSortedArray.md) |
| 4. | [Search in Rotated Sorted Array ](DAY_11/4_searchInRotatedSortedArray.md) |
| 5. | [Median of 2 sorted arrays ](DAY_11/5_medianOfTwoSortedArray.md) |
| 6. | [K-th element of two sorted arrays](DAY_11/6_kthElementOfTwoSortedArrays.md) |
| 7. | [Allocate Minimum Number of Pages ](DAY_11/7_allocatePages.md) |
| 8. | [Aggressive Cows ](DAY_11/8_aggressiveCows.md) |

### Day - 12 (Heap)

| Sn. | Problem |
| --- | --------------------------------------------------------------------------- |
| 1. | [Heap Implementation (Only for interviews)](DAY_12/1_heapImplementation.md) |
| 2. | [Kth Largest Element](DAY_12/2_kthLargestElement.md) |
| 3. | [K Maximum Sum Combination](DAY_12/3_kMaxSumCombinations.md) |
| 4. | [Find Median from Data-Stream](DAY_12/4_findMedianInDataStream.md) |
| 5. | [Merge K sorted arrays](DAY_12/5_mergeKSortedArrays.md) |
| 6. | [K most frequent elements](DAY_12/6_kMostFrequentElements.md) |

### Day - 13 (Stack & Queue - I)

| Sn. | Problem |
| --- | -------------------------------------------------------------------- |
| 1. | [Implement Stack Using Arrays](DAY_13/1_stackArrayImplementation.md) |
| 2. | [Implement Queue Using Arrays](DAY_13/2_queueArrayImplementation.md) |
| 3. | [Implement Stack using Queue](DAY_13/3_stackUsingQueue.md) |
| 4. | [Implement Queue using Stack](DAY_13/4_queueUsingStack.md) |
| 5. | [Check for balanced parentheses](DAY_13/5_balancedParenthesis.md) |
| 6. | [Next Greater Element](DAY_13/6_nextGreaterElement.md) |
| 7. | [Sort a Stack](DAY_13/7_sortAStack.md) |

### Day - 14 (Stack & Queue - II)

| Sn. | Problem |
| --- | ----------------------------------------------------------------------------- |
| 1. | [Next Smaller Element](DAY_14/1_nextSmallerElement.md) |
| 2. | [LRU cache (IMPORTANT)](DAY_14/2_lruCache.md) |
| 3. | [LFU Cache](DAY_14/3_lfuCache.md) |
| 4. | [Largest rectangle in a histogram](DAY_14/4_largestRectangleInHistogram.md) |
| 5. | [Sliding Window maximum](DAY_14/5_slidingWindowMaximum.md) |
| 6. | [Implement Min Stack](DAY_14/6_minStack.md) |
| 7. | [Rotten Orange (Using BFS)](DAY_14/7_rottenOrange.md) |
| 8. | [Stock Span Problem](DAY_14/8_stockSpanProblem.md) |
| 9. | [maximum of minimums of every window size](DAY_14/9_maxOfMinOfEveryWindow.md) |
| 10. | [The Celebrity Problem](DAY_14/10_theCelebrityProblem.md) |

### Day - 15 (String I)

| Sn. | Problem |
| --- | ------------------------------------------------------------------------ |
| 1. | [Reverse Words in a String](DAY_15/1_reverseWord.md) |
| 2. | [Longest Palindromic Substring](DAY_15/2_longestPalindromicSubstring.md) |
| 3. | [Roman Number to Integer and vice versa](DAY_15/3_romanToInt.md) |
| 4. | [Implement ATOI/STRSTR](DAY_15/4_atoiImplementation.md) |
| 5. | [Longest Common Prefix](DAY_15/5_lcp.md) |
| 6. | [Rabin Karp](DAY_15/6_rabinKarp.md) |

### Day - 16 (String II)

| Sn. | Problem |
| --- | ----------------------------------------------------------- |
| 1. | [Z-Function](DAY_16/1_zFunction.md) |
| 2. | [KMP algo / LPS(pi) array](DAY_16/2_KMP.md) |
| 3. | Minimum Characters For Palindrome |
| 4. | [Check for Anagrams](DAY_16/4_checkAnagrams.md) |
| 5. | [Count and Say](DAY_16/5_countAndSay.md) |
| 6. | [Compare version numbers](DAY_16/6_compareVersionNumber.md) |

### Day - 17 (Binary Tree)

| Sn. | Problem |
| --- | ------------------------------------------------------------------------------- |
| 1. | [Inorder Traversal](DAY_17/1_inorderTraversal.md) |
| 2. | [Preorder Traversal](DAY_17/2_preorderTraversal.md) |
| 3. | [Postorder Traversal](DAY_17/3_postorderTraversal.md) |
| 4. | [LeftView Of Binary Tree](DAY_17/4_leftViewOfBinaryTree.md) |
| 5. | [Bottom View of Binary Tree](DAY_17/5_bottomViewOfBinaryTree.md) |
| 6. | [Top View of Binary Tree](DAY_17/6_topViewOfBinaryTree.md) |
| 7. | [Preorder inorder postorder in a single traversal](DAY_17/7_3traversalInOne.md) |
| 8. | [Vertical order traversal](DAY_17/8_verticalOrderTraversal.md) |
| 9. | [Root to node path in a Binary Tree](DAY_17/9_rootToNodePath.md) |
| 10. | [Max width of a Binary Tree](DAY_17/10_maxWidthOfBinaryTree.md) |

### Day - 18 (Binary Tree - 2)

| Sn. | Problem |
| --- | ---------------------------------------------------------------------------------- |
| 1. | [Level order traversal](DAY_18/1_levelOrderTraversal.md) |
| 2. | [Height of a Binary Tree](DAY_18/2_heightOfBT.md) |
| 3. | [Diameter of Binary Tree](DAY_18/3_diameterOfBT.md) |
| 4. | [Check if the Binary tree is height-balanced or not](DAY_18/4_isHeightBalanced.md) |
| 5. | [LCA in Binary Tree](DAY_18/5_LCAOfBT.md) |
| 6. | [Check if two trees are identical or not](DAY_18/6_sameTree.md) |
| 7. | [Zig Zag Traversal of Binary Tree](DAY_18/7_zigZagTraversal.md) |
| 8. | [Boundary Traversal of Binary Tree](DAY_18/8_boundaryTraversalOfBt.md) |

### Day - 19 (Binary Tree - 3)

| Sn. | Problem |
| --- | --------------------------------------------------------------------------------------- |
| 1. | [Maximum path sum](DAY_19/1_maxPathSum.md) |
| 2. | [Construct Binary Tree from inorder and Preorder](DAY_19/2_constructBTFromInAndPre.md) |
| 3. | [Construct Binary Tree from Inorder and Postorder](DAY_19/3_constructBTFromInAndPost.md) |
| 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 |