find path from 2d grid/find the minimum path