← back to unit
Medium
# puzzle gauntlet medium
The Copycat Letter
Now the opposite hunt: the first letter that appears for the SECOND time — the first copycat. 🐱
You get a word. Print the first letter to repeat, or none if all letters are different.
Example:
Input: word = "abcba"
Output: b
Walking letter by letter with a seen-set, a and c are new — then the second "b" is the first letter already seen.
💡 need a hint?
pg-copycat-letter.py🔒 given lines are locked — write your code in between
loading...