Code Room
CodingEasycod-g364
Subject RecursionLevel Mid~15 minCommon in Algorithms & data structures interviewsIndustries Software development

Question

Given a string s (length 1..12) of letters and digits, you may transform every letter into either lowercase or uppercase (digits are unchanged). Return all strings that can be created this way, sorted ascending. The number of outputs is 2 raised to the number of letters in s.

Implement
letter_case_permutation(s: str) → list[str]
Examples
in["a1b2"]out["A1B2","A1b2","a1B2","a1b2"]
What a strong answer looks like

State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.

Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.

Run or narrate your approach, then ask the coach.