Google interview question

I had one graph problem and one string-processing problem.