String
String problems revolve around scanning, comparing, and transforming character sequences — often combined with hashing, two pointers, or a stack. Watch for in-place edits, character counts, and the difference between bytes and Unicode.
9 LeetCode problems solved with the String pattern. Practice them with spaced repetition so the pattern sticks.
- Find the Index of the First Occurrence in a StringEASY · O(n * m)
- Length of Last WordEASY · O(n)
- Longest Common PrefixEASY · O(S)
- Repeated Substring PatternEASY · O(n)
- Reverse String IIEASY · O(n)
- String to Integer (atoi)MEDIUM · O(n)
- Text JustificationHARD · O(n)
- Verifying an Alien DictionaryEASY · O(n * m)
- Zigzag ConversionMEDIUM · O(n)
See the full solution
The complete approach, reference solutions in 5 languages, and a step-by-step visualization — then add this problem to your spaced-repetition schedule.
Start free →