Driver Code
public static void Main ( String [ ] args ) { int [ ] A = { 1 , 2 , 1 , 6 , 5 , 5 , 6 , 1 } ; int [ ] B = { 14 , 8 , 15 , 15 , 9 , 10 , 7 , 12 } ; int N = A . Length ; int C = 40 ; Console . WriteLine ( maxLength ( A , B , N , C ) ) ; } }