D2
Strings
104 stations · 38hString manipulation, KMP, Z-algorithm, Rabin-Karp and palindromes. 104 interview problems explained by codestorywithMIK (38h of video), grouped into 7 patterns such as Frequency & Hashing, Two Pointers, Sliding Window.
Start this line →- Frequency & Hashing28
- Two Pointers15
- Sliding Window13
- Palindromes6
- Pattern Matching (KMP / Z / Rabin-Karp)7
- Parsing & Simulation13
- String Building & Greedy39
Frequency & Hashing
0 of 28 passed- Check if the Sentence Is PangramLC 1832 · 11:49EasyGoogle · Amazon · +4 more companiesLeetCode ↗ (opens in a new tab)
- Integer to Roman -(Amazon, Facebook, Microsoft, Twitter, Apple, Google..): Explanation ➕ Live CodingLC 12 · 17:21MediumGoogle · Amazon · +28 more companiesLeetCode ↗ (opens in a new tab)
- Determine if Two Strings Are CloseLC 1657 · 24:23MediumGoogle · Amazon · +5 more companiesLeetCode ↗ (opens in a new tab)
- Is SubsequenceLC 392 · 19:00MediumGoogle · Amazon · +5 more companiesLeetCode ↗ (opens in a new tab)
- Count Number of Homogenous SubstringsLC 1759 · 12:46MediumGoogle · Virtu FinancialLeetCode ↗ (opens in a new tab)
- Find Unique Binary StringLC 1980 · 24:44MediumGoogle · Amazon · +3 more companiesLeetCode ↗ (opens in a new tab)
- Minimum Number of Steps to Make Two Strings AnagramLC 1347 · 19:24MediumGoogle · Amazon · +8 more companiesLeetCode ↗ (opens in a new tab)
- Custom Sort StringLC 791 · 28:33MediumGoogle · Amazon · +3 more companiesLeetCode ↗ (opens in a new tab)
- Count the Number of Powerful IntegersLC 2999 · 45:21HardGoogle · Meta · +1 more companiesLeetCode ↗ (opens in a new tab)
- Count the Number of Substrings With Dominant OnesLC 3234 · 38:03MediumGoogle · Amazon · +3 more companiesLeetCode ↗ (opens in a new tab)
- Count Collisions on a RoadLC 2211 · 17:40MediumGoogle · Amazon · +1 more companiesLeetCode ↗ (opens in a new tab)
- Find the DifferenceLC 389 · 10:58EasyGoogle · Amazon · +4 more companiesLeetCode ↗ (opens in a new tab)
- Find Words That Can Be Formed by CharactersLC 1160 · 7:23EasyGoogle · Amazon · +5 more companiesLeetCode ↗ (opens in a new tab)
- First Unique Character in a StringLC 387 · 4:45EasyGoogle · Amazon · +21 more companiesLeetCode ↗ (opens in a new tab)
- Check if One String Swap Can Make Strings EqualLC 1790 · 17:03EasyGoogle · Amazon · +3 more companiesLeetCode ↗ (opens in a new tab)
- Maximum Number of Words You Can TypeLC 1935 · 8:38EasyGoogle · Amazon · +2 more companiesLeetCode ↗ (opens in a new tab)
- Find Resultant Array After Removing AnagramsLC 2273 · 17:42EasyGoogle · Amazon · +3 more companiesLeetCode ↗ (opens in a new tab)
- Count Binary SubstringsLC 696 · 12:39EasyGoogle · Amazon · +12 more companiesLeetCode ↗ (opens in a new tab)
- Furthest Point From OriginLC 2833 · 12:33EasyGoogle · Meta · +2 more companiesLeetCode ↗ (opens in a new tab)
Two Pointers
0 of 15 passed- Find the Index of the First Occurrence in a StringLC 28 · 15:32EasyGoogle · Amazon · +14 more companiesLeetCode ↗ (opens in a new tab)
- Reverse Words in a String IIILC 557 · 14:26EasyGoogle · Amazon · +4 more companiesLeetCode ↗ (opens in a new tab)
- Backspace String CompareLC 844 · 18:06EasyGoogle · Amazon · +11 more companiesLeetCode ↗ (opens in a new tab)
- Leetcode 165: Compare Version Numbers with stringstreamLC 165 · 23:20MediumGoogle · Amazon · +8 more companiesLeetCode ↗ (opens in a new tab)
- Append Characters to String to Make SubsequenceLC 2486 · 6:57MediumGoogle · AmazonLeetCode ↗ (opens in a new tab)
- Find the Closest PalindromeLC 564 · 39:09HardGoogle · Amazon · +5 more companiesLeetCode ↗ (opens in a new tab)
- Shortest PalindromeLC 214 · 36:39HardGoogle · Amazon · +6 more companiesLeetCode ↗ (opens in a new tab)
- Sentence Similarity IIILC 1813 · 25:40MediumGoogle · Amazon · +2 more companiesLeetCode ↗ (opens in a new tab)
- Separate Black and White BallsLC 2938 · 13:23MediumGoogle · Amazon · +2 more companiesLeetCode ↗ (opens in a new tab)
- Adding Spaces to a StringLC 2109 · 7:07MediumGoogle · Amazon · +3 more companiesLeetCode ↗ (opens in a new tab)
- Make String a Subsequence Using Cyclic IncrementsLC 2825 · 13:39MediumAmazonLeetCode ↗ (opens in a new tab)
- Move Pieces to Obtain a StringLC 2337 · 38:50MediumGoogle · Amazon · +3 more companiesLeetCode ↗ (opens in a new tab)
- Construct K Palindrome StringsLC 1400 · 40:23MediumGoogle · Amazon · +4 more companiesLeetCode ↗ (opens in a new tab)
- Reverse Prefix of WordLC 2000 · 7:48EasyGoogle · Amazon · +3 more companiesLeetCode ↗ (opens in a new tab)
- Longest PalindromeLC 409 · 19:16EasyGoogle · Amazon · +5 more companiesLeetCode ↗ (opens in a new tab)
Sliding Window
0 of 13 passed- Repeated Substring PatternLC 459 · 21:35EasyGoogle · Amazon · +7 more companiesLeetCode ↗ (opens in a new tab)
- Count Number of Homogenous SubstringsLC 1759 · 12:46MediumGoogle · Virtu FinancialLeetCode ↗ (opens in a new tab)
- Shortest Uncommon Substring in an ArrayLC 3076 · 40:09MediumAirbnb · Affirm · +1 more companiesLeetCode ↗ (opens in a new tab)
- Find Longest Special Substring That Occurs Thrice I & IILC 2981 · 58:52MediumGoogle · Meta · +1 more companiesLeetCode ↗ (opens in a new tab)
- Count the Number of Substrings With Dominant OnesLC 3234 · 38:03MediumGoogle · Amazon · +3 more companiesLeetCode ↗ (opens in a new tab)
- Number of Substrings With Only 1sLC 1513 · 13:49MediumGoogle · Amazon · +1 more companiesLeetCode ↗ (opens in a new tab)
- Largest Substring Between Two Equal CharactersLC 1624 · 13:52EasyMicrosoftLeetCode ↗ (opens in a new tab)
- Minimum String Length After Removing SubstringsLC 2696 · 16:13EasyGoogle · Amazon · +4 more companiesLeetCode ↗ (opens in a new tab)
- Count Binary SubstringsLC 696 · 12:39EasyGoogle · Amazon · +12 more companiesLeetCode ↗ (opens in a new tab)
Palindromes
0 of 6 passed- Unique Length-3 Palindromic SubsequencesLC 1930 · 28:29MediumGoogle · Amazon · +4 more companiesLeetCode ↗ (opens in a new tab)
- Find the Closest PalindromeLC 564 · 39:09HardGoogle · Amazon · +5 more companiesLeetCode ↗ (opens in a new tab)
- Shortest PalindromeLC 214 · 36:39HardGoogle · Amazon · +6 more companiesLeetCode ↗ (opens in a new tab)
- Construct K Palindrome StringsLC 1400 · 40:23MediumGoogle · Amazon · +4 more companiesLeetCode ↗ (opens in a new tab)
- Longest PalindromeLC 409 · 19:16EasyGoogle · Amazon · +5 more companiesLeetCode ↗ (opens in a new tab)
Pattern Matching (KMP / Z / Rabin-Karp)
0 of 7 passed- Find the Index of the First Occurrence in a StringLC 28 · 15:32EasyGoogle · Amazon · +14 more companiesLeetCode ↗ (opens in a new tab)
- Find Beautiful Indices in the Given ArrayLC 3006 · 28:08MediumGoogle · Microsoft · +1 more companiesLeetCode ↗ (opens in a new tab)
- Minimum Time to Revert Word to Initial StateLC 3029 · 1:07:22MediumSprinklrLeetCode ↗ (opens in a new tab)
- Shortest PalindromeLC 214 · 36:39HardGoogle · Amazon · +6 more companiesLeetCode ↗ (opens in a new tab)
- String Matching in an ArrayLC 1408 · 15:39EasyGoogle · Amazon · +3 more companiesLeetCode ↗ (opens in a new tab)
Parsing & Simulation
0 of 13 passed- String CompressionLC 443 · 19:34MediumGoogle · Amazon · +35 more companiesLeetCode ↗ (opens in a new tab)
- Text JustificationLC 68 · 35:17HardGoogle · Amazon · +33 more companiesLeetCode ↗ (opens in a new tab)
- Backspace String CompareLC 844 · 18:06EasyGoogle · Amazon · +11 more companiesLeetCode ↗ (opens in a new tab)
- Fraction Addition and SubtractionLC 592 · 22:26MediumGoogle · Meta · +2 more companiesLeetCode ↗ (opens in a new tab)
- String Compression IIILC 3163 · 7:25MediumGoogle · Amazon · +4 more companiesLeetCode ↗ (opens in a new tab)
- Adding Spaces to a StringLC 2109 · 7:07MediumGoogle · Amazon · +3 more companiesLeetCode ↗ (opens in a new tab)
- Decode the Slanted CiphertextLC 2075 · 24:10MediumGoogle · Amazon · +1 more companiesLeetCode ↗ (opens in a new tab)
- Process String with Special Operations ILC 3612 · 7:54MediumGoogle · Amazon · +2 more companiesLeetCode ↗ (opens in a new tab)
- Process String with Special Operations IILC 3614 · 48:13HardGoogle · Amazon · +2 more companiesLeetCode ↗ (opens in a new tab)
- Divide a String Into Groups of Size kLC 2138 · 12:24EasyGoogle · Bloomberg · +1 more companiesLeetCode ↗ (opens in a new tab)
- Find the K-th Character in String Game ILC 3304 · 17:39EasyGoogle · Amazon · +3 more companiesLeetCode ↗ (opens in a new tab)
- Check If Digits Are Equal in String After Operations ILC 3461 · 10:57EasyGoogle · Amazon · +2 more companiesLeetCode ↗ (opens in a new tab)
- Robot Return to OriginLC 657 · 3:43EasyGoogle · Amazon · +3 more companiesLeetCode ↗ (opens in a new tab)
String Building & Greedy
0 of 39 passed- Words Within Two Edits of DictionaryLC 2452 · 14:38MediumGoogle · Amazon · +2 more companiesLeetCode ↗ (opens in a new tab)
- Check If Two String Arrays are EquivalentLC 1662 · 14:39EasyGoogle · Amazon · +1 more companiesLeetCode ↗ (opens in a new tab)
- Orderly Queue -(Amazon): Explanation ➕ Live CodingLC 899 · 20:17HardAmazon · BloombergLeetCode ↗ (opens in a new tab)
- Make The String GreatLC 1544 · 12:23EasyGoogle · Amazon · +3 more companiesLeetCode ↗ (opens in a new tab)
- Delete Columns to Make SortedLC 944 · 6:56EasyGoogle · Amazon · +2 more companiesLeetCode ↗ (opens in a new tab)
- Restore IP AddressesLC 93 · 38:01MediumGoogle · Amazon · +17 more companiesLeetCode ↗ (opens in a new tab)
- Remove Duplicate LettersLC 316 · 23:04MediumGoogle · Amazon · +7 more companiesLeetCode ↗ (opens in a new tab)
- Decoded String at IndexLC 880 · 22:10MediumAmazon · Meta · +3 more companiesLeetCode ↗ (opens in a new tab)
- Sort Vowels in a StringLC 2785 · 21:59MediumGoogle · Meta · +2 more companiesLeetCode ↗ (opens in a new tab)
- Number of Ways to Divide a Long CorridorLC 2147 · 23:58HardMicrosoft · Bloomberg · +1 more companiesLeetCode ↗ (opens in a new tab)
- Append Characters to String to Make SubsequenceLC 2486 · 6:57MediumGoogle · AmazonLeetCode ↗ (opens in a new tab)
- Separate Black and White BallsLC 2938 · 13:23MediumGoogle · Amazon · +2 more companiesLeetCode ↗ (opens in a new tab)
- Remove Sub-Folders from the FilesystemLC 1233 · 30:19MediumGoogle · Amazon · +6 more companiesLeetCode ↗ (opens in a new tab)
- Minimum Number of Changes to Make Binary String BeautifulLC 2914 · 23:39MediumGoogle · Meta · +2 more companiesLeetCode ↗ (opens in a new tab)
- Construct String With Repeat LimitLC 2182 · 31:49MediumGoogle · Microsoft · +2 more companiesLeetCode ↗ (opens in a new tab)
- Minimum Number of Operations to Move All Balls to Each BoxLC 1769 · 46:07MediumGoogle · Amazon · +4 more companiesLeetCode ↗ (opens in a new tab)
- Construct K Palindrome StringsLC 1400 · 40:23MediumGoogle · Amazon · +4 more companiesLeetCode ↗ (opens in a new tab)
- Construct Smallest Number From DI StringLC 2375 · 35:53MediumGoogle · Amazon · +1 more companiesLeetCode ↗ (opens in a new tab)
- Find the Lexicographically Largest String From the Box ILC 3403 · 27:15MediumGoogle · Amazon · +3 more companiesLeetCode ↗ (opens in a new tab)
- Using a Robot to Print the Lexicographically Smallest StringLC 2434 · 26:07MediumAmazon · Meta · +8 more companiesLeetCode ↗ (opens in a new tab)
- Delete Columns to Make Sorted IILC 955 · 30:50MediumGoogle · Amazon · +1 more companiesLeetCode ↗ (opens in a new tab)
- Maximize Active Section with Trade ILC 3499 · 17:30MediumGoogle · Amazon · +3 more companiesLeetCode ↗ (opens in a new tab)
- Longest Valid ParenthesesLC 32 · 25:37HardGoogle · Amazon · +24 more companiesLeetCode ↗ (opens in a new tab)
- Largest 3-Same-Digit Number in StringLC 2264 · 8:11EasyGoogle · Meta · +3 more companiesLeetCode ↗ (opens in a new tab)
- Largest Odd Number in StringLC 1903 · 9:10EasyGoogle · Amazon · +4 more companiesLeetCode ↗ (opens in a new tab)
- Maximum Score After Splitting a StringLC 1422 · 23:02EasyGoogle · Amazon · +1 more companiesLeetCode ↗ (opens in a new tab)
- Minimum Changes To Make Alternating Binary StringLC 1758 · 25:14EasyAmazon · Meta · +4 more companiesLeetCode ↗ (opens in a new tab)
- Delete Characters to Make Fancy StringLC 1957 · 7:14EasyGoogle · Amazon · +3 more companiesLeetCode ↗ (opens in a new tab)
- Find the Original Typed String ILC 3330 · 10:28EasyGoogle · Amazon · +5 more companiesLeetCode ↗ (opens in a new tab)
- Check if Binary String Has at Most One Segment of OnesLC 1784 · 7:28EasyGoogle · Amazon · +1 more companiesLeetCode ↗ (opens in a new tab)
- Remove Outermost ParenthesesLC 1021 · 11:01EasyGoogle · Amazon · +4 more companiesLeetCode ↗ (opens in a new tab)
- Length of Last WordLC 58 · 13:46EasyGoogle · Amazon · +5 more companiesLeetCode ↗ (opens in a new tab)
All 104 stations in order
- 1.Knuth-Morris-Pratt KMP String Matching Algorithm
- 2.Words Within Two Edits of Dictionary (LeetCode 2452)
- 3.String Compression (LeetCode 443)
- 4.Check if the Sentence Is Pangram (LeetCode 1832)
- 5.Count and Say (LeetCode 38)
- 6.Integer to Roman -(Amazon, Facebook, Microsoft, Twitter, Apple, Google..): Explanation ➕ Live Coding (LeetCode 12)
- 7.Check If Two String Arrays are Equivalent (LeetCode 1662)
- 8.Orderly Queue -(Amazon): Explanation ➕ Live Coding (LeetCode 899)
- 9.Make The String Great (LeetCode 1544)
- 10.Determine if String Halves Are Alike (LeetCode 1704)
- 11.Determine if Two Strings Are Close (LeetCode 1657)
- 12.Detect Capital -(GOOGLE) : Explanation ➕ Live Coding 🧑🏻💻👩🏻💻 (LeetCode 520)
- 13.Delete Columns to Make Sorted (LeetCode 944)
- 14.Restore IP Addresses (LeetCode 93)
- 15.Concatenated Words (LeetCode 472)
- 16.Find the Index of the First Occurrence in a String (LeetCode 28)
- 17.Buddy Strings (LeetCode 859)
- 18.Substring With Largest Variance (LeetCode 2272)
- 19.Repeated Substring Pattern (LeetCode 459)
- 20.Text Justification (LeetCode 68)
- 21.Is Subsequence (LeetCode 392)
- 22.Remove Duplicate Letters (LeetCode 316)
- 23.Decoded String at Index (LeetCode 880)
- 24.Reverse Words in a String III (LeetCode 557)
- 25.Backspace String Compare (LeetCode 844)
- 26.Count Number of Homogenous Substrings (LeetCode 1759)
- 27.Sort Vowels in a String (LeetCode 2785)
- 28.Unique Length-3 Palindromic Subsequences (LeetCode 1930)
- 29.Find Unique Binary String (LeetCode 1980)
- 30.Count Beautiful Substrings I (LeetCode 2947)
- 31.Count Beautiful Substrings II (LeetCode 2949)
- 32.Number of Ways to Divide a Long Corridor (LeetCode 2147)
- 33.Number of Laser Beams in a Bank (LeetCode 2125)
- 34.Minimum Number of Steps to Make Two Strings Anagram (LeetCode 1347)
- 35.Find Beautiful Indices in the Given Array (LeetCode 3006)
- 36.Minimum Time to Revert Word to Initial State (LeetCode 3029)
- 37.Custom Sort String (LeetCode 791)
- 38.Shortest Uncommon Substring in an Array (LeetCode 3076)
- 39.Count Substrings Starting and Ending with Given Character (LeetCode 3084)
- 40.Leetcode 165: Compare Version Numbers with stringstream (LeetCode 165)
- 41.Append Characters to String to Make Subsequence (LeetCode 2486)
- 42.Sort the Jumbled Numbers (LeetCode 2191)
- 43.Fraction Addition and Subtraction (LeetCode 592)
- 44.Find the Closest Palindrome (LeetCode 564)
- 45.Shortest Palindrome (LeetCode 214)
- 46.Sentence Similarity III (LeetCode 1813)
- 47.Separate Black and White Balls (LeetCode 2938)
- 48.Maximum Swap (LeetCode 670)
- 49.Remove Sub-Folders from the Filesystem (LeetCode 1233)
- 50.String Compression III (LeetCode 3163)
- 51.Minimum Number of Changes to Make Binary String Beautiful (LeetCode 2914)
- 52.Adding Spaces to a String (LeetCode 2109)
- 53.Make String a Subsequence Using Cyclic Increments (LeetCode 2825)
- 54.Move Pieces to Obtain a String (LeetCode 2337)
- 55.Find Longest Special Substring That Occurs Thrice I & II (LeetCode 2981)
- 56.Construct String With Repeat Limit (LeetCode 2182)
- 57.Minimum Number of Operations to Move All Balls to Each Box (LeetCode 1769)
- 58.Word Subsets (LeetCode 916)
- 59.Construct K Palindrome Strings (LeetCode 1400)
- 60.Minimum Length of String After Operations (LeetCode 3223)
- 61.Construct Smallest Number From DI String (LeetCode 2375)
- 62.Count the Number of Powerful Integers (LeetCode 2999)
- 63.Find the Lexicographically Largest String From the Box I (LeetCode 3403)
- 64.Using a Robot to Print the Lexicographically Smallest String (LeetCode 2434)
- 65.Count the Number of Substrings With Dominant Ones (LeetCode 3234)
- 66.Number of Substrings With Only 1s (LeetCode 1513)
- 67.Count Collisions on a Road (LeetCode 2211)
- 68.Delete Columns to Make Sorted II (LeetCode 955)
- 69.Decode the Slanted Ciphertext (LeetCode 2075)
- 70.Process String with Special Operations I (LeetCode 3612)
- 71.Process String with Special Operations II (LeetCode 3614)
- 72.Maximize Active Section with Trade I (LeetCode 3499)
- 73.Longest Valid Parentheses (LeetCode 32)
- 74.Minimum Operations to Sort a String (LeetCode 3863)
- 75.Find the Difference (LeetCode 389)
- 76.Find Words That Can Be Formed by Characters (LeetCode 1160)
- 77.Largest 3-Same-Digit Number in String (LeetCode 2264)
- 78.Largest Odd Number in String (LeetCode 1903)
- 79.Valid Anagram (LeetCode 242)
- 80.Maximum Score After Splitting a String (LeetCode 1422)
- 81.Minimum Changes To Make Alternating Binary String (LeetCode 1758)
- 82.Largest Substring Between Two Equal Characters (LeetCode 1624)
- 83.First Unique Character in a String (LeetCode 387)
- 84.Reverse Prefix of Word (LeetCode 2000)
- 85.Longest Palindrome (LeetCode 409)
- 86.Minimum String Length After Removing Substrings (LeetCode 2696)
- 87.Delete Characters to Make Fancy String (LeetCode 1957)
- 88.Rotate String (LeetCode 796)
- 89.String Matching in an Array (LeetCode 1408)
- 90.Check if One String Swap Can Make Strings Equal (LeetCode 1790)
- 91.Divide a String Into Groups of Size k (LeetCode 2138)
- 92.Find the Original Typed String I (LeetCode 3330)
- 93.Find the K-th Character in String Game I (LeetCode 3304)
- 94.Valid Word (LeetCode 3136)
- 95.Maximum Number of Words You Can Type (LeetCode 1935)
- 96.Find Resultant Array After Removing Anagrams (LeetCode 2273)
- 97.Check If Digits Are Equal in String After Operations I (LeetCode 3461)
- 98.Count Binary Substrings (LeetCode 696)
- 99.Check if Binary String Has at Most One Segment of Ones (LeetCode 1784)
- 100.Robot Return to Origin (LeetCode 657)
- 101.Furthest Point From Origin (LeetCode 2833)
- 102.Remove Outermost Parentheses (LeetCode 1021)
- 103.Find First Palindromic String in the Array (LeetCode 2108)
- 104.Length of Last Word (LeetCode 58)