
Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Irrespective of what path the robot takes, it will have to traverse all the rows between startRow and homeRow and all the columns between startCol and homeCol.
Hence, making any other move other than traversing the required rows and columns will potentially incur more cost which can be avoided.