Question DSA-HASH-0064
HardWhat is the output of this code?
d = {}
for w in ["listen", "silent", "enlist", "google", "gogole", "cat"]:
d.setdefault("".join(sorted(w)), []).append(w)
print(max(len(v) for v in d.values()), len(d))
- A.
3 3
- B.
3 6
- C.
Sign up free to see the answer and a step-by-step explanation.