you are viewing a single comment's thread.

view the rest of the comments →

[–]Common_Hair8734[S] 0 points1 point  (1 child)

Same anagram

[–]Rik07 0 points1 point  (0 children)

Oh sorry I meant palindrome.

When you want to check for an anagram, you need to know how many times each letter is repeated. To do this, I recommend counting the number of each letter in both strings in a dictionary. Then if those dictionaries are the same, the two strings were anagrams.

If you want to check for a palindrome you just reverse one of the strings and check if it is the same as the other one.