Strings
Master string manipulation and pattern matching
Strings are sequences of characters and one of the most commonly used data types in programming. Understanding string manipulation, searching, and pattern matching is essential for solving a wide variety of real-world problems.
Key Concepts
- Immutable in many languages (Java, Python)
- Common operations: concatenation, substring, search
- Two pointers technique for palindromes and anagrams
- Pattern matching with KMP, Rabin-Karp algorithms
- String building with StringBuilder for efficiency
Problems
Valid PalindromeEasy
Check if a string is a palindrome ignoring non-alphanumeric characters
Two PointersString Manipulation
Valid Anagram
EasySoonDetermine if two strings are anagrams of each other
Hash MapSorting
Longest Substring Without Repeating
MediumSoonFind length of longest substring without repeating characters
Sliding WindowHash Map
Longest Palindromic Substring
MediumSoonFind the longest palindromic substring in a string
Dynamic ProgrammingExpand Around Center
Group Anagrams
MediumSoonGroup strings that are anagrams of each other
Hash MapSorting
Minimum Window Substring
HardSoonFind minimum window containing all characters of another string
Sliding WindowHash Map