Amazon Interview Question

edit distance problem, graph problem