Notice Period

Same Letters, Different Order

easy

Two players claim they were dealt the same letter tiles, just shuffled differently.

Given strings a and b, return True if b uses exactly the same letters as a with the same multiplicities — i.e. one is an anagram of the other.

Example 1
in a = "listen", b = "silent"
out True
Example 2
in a = "rat", b = "car"
out False
Constraints
  • · 1 <= len(a), len(b) <= 5 * 10^4
  • · a and b are lowercase English letters
similar problem on LeetCode ↗
solution.pyloading python…
test results
Hit ▶ Run to test your code against the visible cases.