Valid Anagram
Write the code, see it run, pass the checks.
The problem
- easy
- Code
Write isAnagram(a, b): return true if b uses exactly the same characters as a, each the same number of times, in any order, and false otherwise. Compare characters exactly as given: upper and lower case are different, and spaces count like any other character. Two empty strings are anagrams. For example, isAnagram("listen", "silent") is true, but isAnagram("rat", "car") and isAnagram("Listen", "silent") are false.
Your code must pass
- Recognises anagrams
- Rejects strings with different letters
- Counts repeated letters
- Treats upper and lower case as different