Bloomberg interview question

Leet code question Decode String 394