Question: Decode String Coding UNSOIVID Problem Statement You are learning cryptography and as a challenge, your friend gave you this problem to decode. You are given
Decode String
Coding
UNSOIVID
Problem Statement
You are learning cryptography and as a challenge, your friend gave you this problem to decode. You are given an encoded string. To decode the string, the encoded string is read one character at a time and the following steps are taken:
If the character read is a letter, that letter is written in the decoded string.
If the character read is a digit, say the entire decoded string is repeatedly written more times in total
Finally, given an integer you need to return the th letter from the decoded string.
Input format
The first line will have lastring s
The second line will have an integer
Output format
The character on the index of the decoded string.
Constraints
slength
s consists of lowercase English letters and digits through
s start with a letter.
It is guaranteed that is less than or equal to the length of the decoded string.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
