Recursive function to check whether there is a path from the top left cell to the bottom right cell of the maze
static boolean findPath ( ArrayList < ArrayList < Integer > > maze , int xpos , int ypos , boolean key ) {