Playing with anagrams

Created by Julien Palard

Write a simple function, named is_anagram, taking two strings, and returning a boolean value.

The function shall return True if the letters of one word are a rearrangement of the letters of the other, False otherwise.

Superfluous (or missing) spaces, quotes, dashes, ... are allowed: funeral is an anagram of real fun.

Capitalized letter are equivalent to lower case letters: Madam Curie is an anagram of Radium came.

Diactirics of any language are ignored: crâné is an anagram of crane.

Hints

Don't use the unidecode library: it is not installed on the correction server.

Don't use a big replacement dict, or a big chain of .replace: it is not clean and you'll always forget some, like: Ÿ, ǹ, j̄…

Your goal is just to remove diacritics, which can be done using the unicode normal form decomposed or the string and then remove the combining characters.

To switch to the decomposed form, use the normalize function, and to tell appart combining and non-combining characters use the combining function.

There's no corrections yet, hit the `Submit` button to send your code to the correction bot.

Keyboard shortcuts:

  • Ctrl-Enter: Send your code to the correction bot.
  • Escape: Get back to the instructions tab.

See solutions