Palindrome Problems
Palindrome Problems
Palindrome Problems
Check if a string is a palindrome:
Write a function to check if a given string reads the same forward and backward.
Group anagrams:
Given a list of strings, group them into groups of anagrams.
4. Pattern Matching
Check if a string contains another string:
Implement a function to check if one string is a substring of another.
Wildcard Matching:
Given a string and a pattern (with * and ?), determine if they match.
5. Transformations
Reverse words in a string:
Reverse the order of words in a sentence while keeping the words intact.
Remove vowels from a string:
Write a function to remove all vowels from a given string.
Run-length encoding:
Encode a string using run-length encoding (e.g., "aaaabbcc" → "4a2b2c").
8. Advanced Problems
Check if a string is a valid shuffle:
Given three strings, check if one is a valid shuffle of the other two.
Edit Distance:
Find the minimum number of operations (insert, delete, replace) to convert one
string to another.
9. Coding Challenges
Valid Parentheses:
Check if a string of parentheses ("()[]{}") is valid.
Reorganize String:
Rearrange characters in a string so that no two adjacent characters are the same.
Implement strstr():
Write a function to find the first occurrence of a substring in another string.
Tips for Practice
Start Simple: Begin with basic problems (e.g., reversing a string) to build
confidence.
Use Built-in Functions Sparingly: Try to solve problems without relying on library
functions for deeper understanding.
Write Test Cases: Test your solution on edge cases (e.g., empty string, single
character).
Optimize: After solving, revisit your solution to improve its efficiency.