An encoded string (s) is given, the task is to decode it. The pattern in which the strings were encoded were as follows original string: abbbababbbababbbab encoded string : 3[a3[b]1[ab]]
Input: s = 1[b]
Explaination: 'b' is present only one time.
Input: s = 3[b2[ca]]
Explaination: 2[ca] means 'ca' is repeated
twice which is 'caca' which concatenated with
'b' becomes 'bcaca'. This string repeated
thrice becomes the output.
You do not need to read input or print annything. Your task is to complete the function decodedString() which takes s as input parameter and returns the decoded string.
Expected Time Complexity: O(|s|) Expected Auxiliary Space: O(|s|)