19 September 2026
No-Repeat Box Codes
Medium
Lists
Strings
Sets
Keep the storage box codes that do not reuse any letter.
An archive labels its storage boxes with short lowercase codes. A code is clear only when no letter appears more than once in that code. Go through the codes in their given order. Keep every clear code and leave out every code that repeats a letter. Return the kept codes in the same order.
Constraints
codes contains from 0 to 1,000 lowercase stringsEach code contains from 1 to 30 lowercase ASCII lettersCompare letters exactly as written
Function signature
def unique_codes(codes):