Output Format is not clear(Mapped String)

Do I have to print the null string as a combination or not. Do I need to ignore the 0 in the input number? What does it mean by printing in the sorted order? Does it mean that individual combination like a comb CBA printed as ABC or all the combinations as a whole should be sorted?

Hello @isa67719,

Here are the answers to your questions:

  1. No, you don’t have to print null string.

  2. No, You do not have to ignore 0 always.
    …You can ignore all 0s at the start of the string, coming before any other digit. Example: 000987 ==> 987.
    …If it is coming between two non zero numbers, then you can ignore it for the case when you are considering it individually or with any digit but at left side(i.e. higher order digit). In this case you can use this zero at ones place of the two digit number. example: 01,02, etc ignore and 10 and 20 can be considered.
    …if multiple Zeros are at end of string. Example: 2340000 ==>2340, you can ignore all unnecessary 0s.

  3. One you have all the combinations of alphabetic string, print then in lexicographical order.
    …You are not required to sort alphabets of each string, example: CBA to ABC.
    …You have to print different string in lexicographical order example: ABC, ACB, CBB, AAB output: AAB,ABC,ACB,CBB.

Hope, this would help.
Give a like if you are satisfied.

Alright. I am not able to understand what does it mean by “print all possible strings”. Can you give me some other examples apart from the sample input. Please explain what will be the output for 1023 or 1432 ?

Let’s Start with 1023;

[1,2,3] =ABC
[1,23]=AW
[10,2,3]=JBC
[10,23]=JW

Now, coming to the next example 1432

[1,4,3,2]=ADCB
[14,3,2]=NCB

BTW you have to consider the case of single 0 between non-zero digits only. Rest you can ignore.

It may be assumed that the input contains valid digits from 0 to 9 and there are no leading 0’s, no extra trailing 0’s and no two or more consecutive 0’s.

Hope, this would help.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.