Driver code
int main ( ) { int a [ ] = { 1 , 2 , 3 , 4 , 5 } ; int b [ ] = { 5 , 4 , 3 , 2 , 1 } ; int n = sizeof ( a ) / sizeof ( a [ 0 ] ) ; int x = 3 , y = 3 ; cout << solve ( 0 , x , y , a , b , n ) ; return 0 ; }