← Back to challenges

Check for Anagrams

PythonHardstringsmathvalidationinterview

Instructions

Create a function that takes two strings and returns either True or False depending on whether they're anagrams or not.

Examples

is_anagram("cristian", "Cristina") ➞ True

is_anagram("Dave Barry", "Ray Adverb") ➞ True

is_anagram("Nope", "Note") ➞ False

Notes

  • Should be case insensitive.
  • The two given strings can be of different lengths.
python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Is One List a Subset of Another?