Bloomberg Interview Question

Leet code question Decode String 394