Skip to content

06. Hashing & Strings

🧠 Strategy: Hashing & Strings

  1. Frequency Map: Use HashMap<Character, Integer> for anagrams or counting chars.
  2. Subarray Sum: Use a map to store (cumulativeSum, index). If sum - k exists in map, you found a subarray.
  3. Sliding Window: Use a Map to track counts inside the current window [L, R].
  4. Pattern Matching: For standard patterns, use KMP (LPS array) or Z-Algorithm.

🟢 Basic Strings

🟡 Hashing: Arrays & Zero Sums

🟠 Hashing: Windows & Sequences

🔴 Advanced Pattern Matching

🟣 Hashing: Geometry