Back to Topics

strings Mastery

Global Progress0%
0/ 0

Topic Cheat Sheet

Pattern Matching

  • KMP AlgorithmLPS array, O(n+m) substring search
  • Rabin-KarpRolling hash, O(n+m) avg, good for multiple patterns
  • Z-AlgorithmZ-array for pattern occurrences in O(n+m)

Two Pointers / Sliding Window

  • Palindrome Checkleft/right pointers moving inward
  • Longest Substring (No Repeat)Sliding window + HashSet
  • Minimum Window SubstringExpand right, shrink left, freq map
  • Anagram DetectionFixed-size window + char frequency

HashMap / Frequency

  • Valid Anagramint[26] freq count comparison
  • Group AnagramsSorted string as key → HashMap grouping
  • First Unique CharFrequency array + single pass
  • Ransom NoteFreq count of available chars

DP & Stack

  • Longest Palindromic SubstringExpand around center or dp[i][j]
  • Edit DistanceInsert/delete/replace, dp[i][j]
  • Valid ParenthesesStack: push open, pop on close
  • Decode StringStack of [string, count] pairs
Advanced Filters

Patterns0

Difficulty

Curated Lists

Questions0

SolvedReviseQuestionDifficultyPatternsVideo
No questions found matching your filters.

Ready for more?

Continue your journey with the next pattern.

Next Topic: Dynamic Programming