Given a String A and an integer B. String A is encoded consisting of lowercase English letters and numbers. A is encoded
in a way where repetitions of substrings are represented as substring followed by the count of substrings.
For example: if the encrypted string is “ab2cd2” and B=6, so the output will be ‘d’ because the decrypted string is
4th character is ‘b’.
You have to find and return the Bth character in the decrypted string.
Note: Frequency of encrypted substring can be of more than one digit. For example,
in “ab12c3”, ab is repeated 12 times. No leading 0 is present in the frequency of substring.
The arguments given are string A and integer B.
Return the Bth character in the decrypted string.
1 <= length of the array <= 10^5 1 < = K < = 10^9
Input 1: A = "ab2c3" B = 8 Output 1: a Decrypted string will be "ababcababcababc" and 'a' is the 8th character. Input 2: A = "x2y3" B = 3 Output 2: y Decrypted string will be "xxyxxyxxy"
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a doubt? Checkout Sample Codes for more details.