Not able to write correct logic
Please tell correct approach
Mapped strings question
Hello @dsingh200021,
Let’s understand the question first.
Consider two examples:
-
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
Notes:
-
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. -
The range of numbers that you can consider is from 1 to 26, not more than 26.
You can refer to the following code for better understanding:
Hope, this would help.
Give a like, if you are satisfied.