Driver code
public static void main ( String [ ] args ) { int a [ ] = { 1 , 2 , 3 , 4 , 5 } ; int b [ ] = { 5 , 4 , 3 , 2 , 1 } ; int n = a . length ; int x = 3 , y = 3 ; System . out . println ( solve ( 0 , x , y , a , b , n ) ) ; } }