Amazon interview question

edit distance problem, graph problem