Draft

Combinations of uppercase and lowercase for a string

2 of 3healytpk

Description:

Given any input string, run through all the possible combinations of uppercase and lowercase.

Example No. 1:

  • input: dE

  • output: DE dE De de

Example No. 2:

  • input: cat346

  • output: cat346 Cat346 cAt346 CAt346 caT346 CaT346 cAT346 CAT346

Write a function called 'GetCombos' which has two parameters:

  • 1st Parameter = A modifiable string (max length = 63 characters)

  • 2nd Parameter = A callback function to be invoked for each combination

Constraints:

(1) If the string supplied to GetCombos is invalid, empty or too long then do nothing (just return immediately without invoking the callback function)

(2) If the callback function supplied to GetCombos is invalid then do nothing (just return immediately without invoking the callback function)

(3) Don't invoke the callback function with an invalid or empty string

(4) The output may be sorted or unsorted -- the order doesn't matter

(5) The output must not contain duplicates

Algorithms

More By Author:

Check out these other kata created by healytpk

Stats:

CreatedOct 25, 2022
Warriors Trained6
Total Skips0
Total Code Submissions9
Total Times Completed3
C Completions2
C++ Completions2
Total Stars0
% of votes with a positive feedback rating25% of 2
Total "Very Satisfied" Votes0
Total "Somewhat Satisfied" Votes1
Total "Not Satisfied" Votes1
Total Rank Assessments2
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
6 kyu
Ad
Contributors
  • healytpk Avatar
Ad