Letter Case Permutation
MediumBacktrackingbacktracking
Solve this the way you would in the interview: out loud, on a timer, with an AI interviewer asking follow-ups while you code. You get a scored report at the end.
Practice this as a mock interviewFree to start, no account neededProblem
Given a string s of English letters and digits, every letter may independently be written in lowercase or uppercase, while digits stay as they are.
Return every distinct string that can be produced this way. The strings may be returned in **any order**; the grader ignores order.
Examples
Input: s = "a1b2"
Output: ["a1b2","a1B2","A1b2","A1B2"]
Two letters, two choices each.
Input: s = "3z4"
Output: ["3z4","3Z4"]
Only z can change case.
Constraints
- 1 <= s.length <= 12
- s consists of lowercase letters, uppercase letters, and digits.
What the interviewer grades
A correct solution is one of five scores. The report also grades problem understanding (did you clarify inputs and edge cases before coding), problem solving, communication while you work, code quality, and testing. See a sample report, or read up on the pattern in the lessons.