Tripadvisor Interview Question

The string tokenizing question that was already posted here.