Driver code
public static void main ( String [ ] args ) { ArrayList < ArrayList < Integer > > maze = new ArrayList < ArrayList < Integer > > ( ) ; maze . add ( new ArrayList < Integer > ( Arrays . asList ( 1 , 2 , 3 ) ) ) ; maze . add ( new ArrayList < Integer > ( Arrays . asList ( 4 , 5 , 6 ) ) ) ; maze . add ( new ArrayList < Integer > ( Arrays . asList ( 7 , 8 , 9 ) ) ) ; findPaths ( maze , 3 , 3 ) ; } }