Bird
Raised Fist0

Given the input string "b2C", what is the output list of all letter case permutations?

easy🧾 Trace Q3 of Q15
Subsets & Combinations - Letter Case Permutation
Given the input string "b2C", what is the output list of all letter case permutations?
A["b2c", "b2C"]
B["b2C", "B2C"]
C["b2c", "B2c"]
D["b2c", "b2C", "B2c", "B2C"]
Step-by-Step Solution
Solution:
  1. Step 1: Identify letters and digits

    Letters: 'b', 'C'; Digit: '2' remains unchanged.
  2. Step 2: Generate permutations

    Toggle 'b' -> 'b' or 'B'; toggle 'C' -> 'c' or 'C'. Combine with '2' fixed.
  3. Final Answer:

    Option D -> Option D
  4. Quick Check:

    2 letters yield 2^2=4 permutations [OK]
Quick Trick: Number of permutations = 2^(number of letters) [OK]
Common Mistakes:
MISTAKES
  • Changing digits mistakenly
  • Missing some case toggles
Trap Explanation:
PITFALL
  • Ignoring digits or toggling digits leads to wrong outputs.
Interviewer Note:
CONTEXT
  • Tests ability to trace letter case permutation outputs.
Master "Letter Case Permutation" in Subsets & Combinations

3 interactive learning modes - each teaches the same concept differently

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Subsets & Combinations Quizzes