Driver code
public static void main ( String [ ] args ) { int A [ ] = { 2 , 3 , 1 , 4 , 5 } ; int B [ ] = { 2 , 2 , 1 , 4 , 2 } ; int size = A . length ; System . out . println ( solve ( A , B , size ) ) ; } }