String Problems

  1. Reverse a string.
  2. Check whether a string is a palindrome.
  3. Count each character’s frequency.
  4. Find the first non-repeating character.
  5. Check whether two strings are anagrams.
  6. Remove duplicate characters while preserving order.
  7. Find the longest word in a sentence.
  8. Compress repeated characters, such as aaabb to a3b2.
  9. Check whether a string contains only digits without using isdigit().
  10. Find the longest common prefix in a list of words.