Skip to content
← Back to the archive

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 strings
  • Each code contains from 1 to 30 lowercase ASCII letters
  • Compare letters exactly as written

Function signature

def unique_codes(codes):

Sign in to solve this bracket

Reading the problem is free for everyone. Opening the editor and solving it requires an account with Open Bracket+.