Function to find all possible paths to reach end of array requiring minimum number of steps
public static void possiblePath ( int [ ] arr , int [ ] dp ) { Queue < Pair > queue = new LinkedList < > ( ) ; queue . add ( new Pair ( 0 , " " + 0 , dp [ 0 ] ) ) ; while ( queue . size ( ) > 0 ) { Pair tmp = queue . remove ( ) ; if ( tmp . jmps == 0 ) { System . out . println ( tmp . psf ) ; continue ; } for ( int step = 1 ; step <= arr [ tmp . idx ] ; step ++ ) { if ( tmp . idx + step < arr . length && tmp . jmps - 1 == dp [ tmp . idx + step ] ) {