Driver code
static public void Main ( ) { int [ ] arr1 = { 0 , 1 , 0 , 1 , 1 , 1 , 1 } ; int [ ] arr2 = { 1 , 1 , 1 , 1 , 1 , 0 , 1 } ; int n = arr1 . Length ; Console . WriteLine ( longestCommonSum ( arr1 , arr2 , n ) ) ; } }