Zenconde is a type of encoding that supports 3 types of values:
Zencode is defined as follow:
The goal of this exercise is to write a parser that can read a Zencode string. The inputs and outputs for this function are described below:
INPUT: String zencodedData -- the Zencoded string
OUTPUT: an Object that represents the underlying data encoded in "zencodedData"
10 -> "i10e"
"word" -> "4:word" ( 4 here is the length of the "word" )
[1, [0]] -> "li1eli0eee" ( "e" means end - 1 e for end of list, 1 e for end of int, and 1 e again for end of list ) :: "l" mean start of list/array
Input is the right side. Output is left.
Example:
Input: "li1eli0eee"
Output: [1, [0]]
Input: "lli456eee"
Output: [[456]]I couldn't solve it in time. ANy thoughts? Using stack based approach?