LeetCode 784 Letter Case Permutation - Problem Statement

The problem

Given a string, return all possible strings where each letter can be lowercase or uppercase.

With "a1b2":

  • 'a' can be 'a' or 'A'
  • 'b' can be 'b' or 'B'
  • Digits stay the same

Result: ["a1b2", "a1B2", "A1b2", "A1B2"].

Non-letter characters remain unchanged.

Constraints: 11 \le length 12\le 12. String contains letters and digits only.