Google Interview Question

string mutilation and graph question