Function to find Longest Possible Route in the matrix with hurdles . If the destination is not reachable the function returns false with cost Integer . MAX_VALUE . ( i , j ) is source cell and ( x , y ) is destination cell .
static Pair findLongestPathUtil ( int mat [ ] [ ] , int i , int j , int x , int y , boolean visited [ ] [ ] ) {