* (m,n) is the last cell where we want to reach.
Function getMinimum(int, int, int); is a simple function which accepts 3 int values and return the minimum of them.
What if the shortest path is a snake that ca go in all 8 directions?