- 0of 0 votes
Minimum number of moves to collect all the objects and reach the given point in a NxM matrix- po55ible August 16, 2015 in United States
:- There is a maze of size n*n. Tom is sitting at (0,0). Jerry is sitting in another cell (the position of Jerry is input). Then there are k pieces of cheese placed in k different cells (k <= 10). Some cells are blocked while some are not. Tom can move to 4 cells at any point of time (left, right, up, down one position). Tom has to collect all the pieces of cheese and then reach to Jerry’s cell. You need to print the minimum no. of steps required to do so.
| Report Duplicate | Flag | PURGE
Open Chat in New Window