Skip to content
C

Anagram Checker

Mediumpython

Check whether two strings are anagrams of each other — made of exactly the same letters, rearranged, ignoring case and spaces.

Approach: strip spaces and lower-case both strings, sort their characters, and compare the sorted results — two anagrams will always produce identical sorted character lists.

Input: Two lines: the first string, then the second string.

Output: One line: They are anagrams or They are not anagrams.

Input (stdin)

Output

Run your code to see output here...