Pergunta de entrevista da empresa Google

Grid traversal question, parsing through strings and finding "children" of strings