Amazon interview question

Shortest path between coordinates merge sort etc