Math Fundamentals18 sections · 814 units
Open in Course

Practice - Letter Case Permutation

(LeetCode 784)

Given a string with letters and digits, return all possible strings by toggling the case of each letter.

Example: "a1b2" → ["a1b2", "a1B2", "A1b2", "A1B2"].

Hint: Use backtracking. For each letter, branch into two cases: lowercase and uppercase.