String Problems Topic Wise
Last Updated :
07 Nov, 2024
Improve
In this post, string problems based on different topics are mentioned. Please refer String Data Structure article for fundamentals, basic operations and problems based on difficulty.
Binary String:
- Check if all bits can be made same by single flip
- Number of flips to make binary string alternate
- Binary representation of next number
- Min flips of continuous characters to make all characters same in a string
- Generate all binary strings without consecutive 1’s
- Find i’th Index character in a binary string obtained after n iterations
- Generate n-bit Gray Codes
Substring & Subsequence:
- All Occurrences of a Substring
- All substrings of a given string
- Check for Subsequence
- All subsequences of a string
- All Occurrences of a Substring
- Count Distinct Subsequences
- Count distinct occurrences as a subsequence
- Longest Common Subsequence
- Shortest Superstring Problem
- Printing Shortest Common Supersequence
- Shortest Common Supersequence
- Longest Repeating Subsequence
- Longest Palindromic Subsequence
Pattern Searching:
- Naive algorithm for Pattern Searching
- KMP Algorithm for Pattern Searching
- Z algorithm
- Word Search - 8 Directions & Straight Movement
- Word Search - 4 Directions & Zig-Zag Allowed
- Wildcard Pattern Matching
- Aho-Corasick Algorithm
- Strings that match specific pattern
- Check if string follows a defined order
- Regular Expression Matching
Problems on Palindrome String:
- Check for Palindrome
- Check for rotation of a palindrome
- Check if rearrangement can form a palindrome
- Checking palindromes in a stream
- Print all palindromic partitions of a string
- Minimum additions at front to make palindrome
- Make largest palindrome by changing at most K-digits
- Minimum deletions to make palindrome
- Minimum insertions for palindrome with permutations