array at n - 1 index ( tri [ i ] ) stores all possible adding combination , finding the maximum one out of them
int max = tri [ n - 1 ] [ 0 ] ; for ( int i = 1 ; i < n ; i ++ ) { if ( max < tri [ n - 1 ] [ i ] ) max = tri [ n - 1 ] [ i ] ; } return max ; }