String Algorithms

Edit Distance

  • Hamming Distance

Exercises

  • Find the first non-repeated character in a string.
  • Reverse a string iteratively and recursively.
  • Determine if 2 strings are anagrams.
  • Check if string is a palindrome.
  • Check if a string is composed of all unique characters.
  • Determine if a string is an int or a double.
  • Find the shortest palindrome in a string.
  • Print all permutations of a string.
  • Given a single-line text string and a maximum width value, write the function ‘String justify(String text, int maxWidth)’ that formats the input text using full-justification, i.e., extra spaces on each line are equally distributed between the words; the first word on each line is flushed left and the last word on each line is flushed right.
  • Given a list of strings, write a function in Python to return all the strings that are anagrams.