Driver Code
int main ( ) { int A [ ] = { 1 , 2 , 1 , 6 , 5 , 5 , 6 , 1 } ; int B [ ] = { 14 , 8 , 15 , 15 , 9 , 10 , 7 , 12 } ; int N = sizeof ( A ) / sizeof ( A [ 0 ] ) ; int C = 40 ; cout << maxLength ( A , B , N , C ) ; return 0 ; }