We have a building that consists of 6 by 6 rooms, separated by walls or doors.
A number in the middle of a room is supposed to be a key. You can collect keys as you walk through the rooms.
A number between two rooms is supposed to be a door: you'll need a key of the same number in order to pass that door.
Of course, this will force you to find your path through different rooms before you reach the target room.
In this maze:
Find the shortest path from R1C1 to R6C6.
Also, find the shortest path from R6C6 to R6C1.