A collection of characters is used to construct a word or a sentence. The position of each character in a word matters, since different character positions can cause the word to have different meanings. For example, when you rearrange the characters in God, you will get Dog.
There are two methods in strings to find another word from a word, or to ensure a word has exactly the same spelling both forward and backward. Let's play with them.
An anagram is a word that is produced by rearranging the letters of the word itself. Let's take a look at the word ELBOW. We can say that BELOW is anagram of ELBOW, since BELOW uses all the original letters of ELBOW exactly once. Not only from one word, an anagram can also be created from, and can create, two or more words: SCHOOL MASTER is an anagram of THE CLASSROOM, or FOURTH OF JULY is an anagram of JOYFUL FOURTH.
Checking whether two strings are an anagram or not is quite easy. We just need to sort...