Strings are a fundamental data-type. Knowing the string manipulation techniques available in your language will serve you well during whiteboarding interviews. Here are a list of patterns you can practice and memorize in your language:
- Iterating through characters in a string, with and without keeping track of the index
- Slicing strings given a start and an end index
- Finding the index of a target character
- Getting all possible substrings of certain length
- Getting all possible sets of pairs and triples
- Getting the counts of each character in a string
- How to make a function case-sensitive and case-insensitive
The more quickly you can memorize patterns for string manipulation, the more capacity you will have for problem solving!
- 20. Valid Parentheses & My Solution
- Distinct Subsequences
- 344. Reverse String & My Solution
- String Compression
- 678. Valid Parenthesis String & My Solution
- 696. Count Binary Substrings & My Solution
- Alphabet Board Path
- Number of Steps to Reduce a Number in Binary Representation to One
- Hashmaps & Stacks
- Two-pointer approach
- Interval Balancing
- Backtracking & Recursion