SubWords
CodeChefOpen on judge ↗
For the input word and a number, print all possible combinations that have as many characters as specified by the number. For example, CAT 2 would produce CA, CT, AT and DOG 1 would produce D, O ,G .Note, that we are producing combinations WITHOUT replacement, so in the CAT 2 example, CC , AA and TT are NOT possible combinations. Input Accept a line of input entered from standard input. A vali
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start