← back to unit
Medium
# power tools medium
Anagram Twins, Turbo Mode
You caught secret twins with sorting — now catch them with counting: twins use each letter the SAME number of times. 👯⚡
You get words a and b. Build a letter-count dict for each and print twins if the dicts are equal, otherwise not twins.
Example:
Input: a = "night", b = "thing"
Output: twins
Both words use each letter (g, h, i, n, t) exactly once, so their letter-count dicts come out equal.
💡 need a hint?
pt-anagram-turbo.py🔒 given lines are locked — write your code in between
loading...