06. Hashing & Strings
🧠Strategy: Hashing & Strings
- Frequency Map: Use
HashMap<Character, Integer>for anagrams or counting chars. - Subarray Sum: Use a map to store
(cumulativeSum, index). Ifsum - kexists in map, you found a subarray. - Sliding Window: Use a Map to track counts inside the current window
[L, R]. - Pattern Matching: For standard patterns, use KMP (LPS array) or Z-Algorithm.
🟢 Basic Strings
- Reverse The String
- Simple Reverse
- Toggle Case
- Palindrome String
- Largest Palindrome
- Length Of Last Word
- Count A
🟡 Hashing: Arrays & Zero Sums
- Subarray With Zero Sum
- Largest Continuous Sequence Zero Sum
- Subarray Sum Equals K
- Subarray With Given Sum
- Diffk II
- First Repeating Element
- Common Elements
- Check Palindrome II
- Find Pairs Sum Present
- Pairs With Given Xor
🟠Hashing: Windows & Sequences
- Longest Consecutive Sequence
- Distinct Numbers In Window
- Window String
- Longest Substring Without Repeat
- Permutations Of A In B
- Shaggy And Distances
- Is Dictionary
- Valid Sudoku
- Colorful Number
- Sort Array In Given Order
- Compare Sorted Subarrays
🔴 Advanced Pattern Matching
- Cyclic Permutations
- Period Of A String
- Smallest Prefix String
- Closest Palindrome
- Make String Palindrome
- Boring Substring
- Replicating Substring