Microsoft Interview Question

string traversal and data structure