LinkedIn interview question

String manipulation, and graph questions as well