173. uncompress string
Share
medium - accepted / - tried
Given a compressed string, return its original form.
For example.
uncompress('3(ab)') // 'ababab'uncompress('3(ab2(c))') // 'abccabccabcc'
- a number
k
followed by a pair of parenthesis, meaning to repeat the substring inside the parenthesis byk
times,k
is positive integer. - inputs are guaranteed to be valid input like above example, there is no numerical digit in original form.