Parse a nested list from a string | TikTok Interview Question