Returns largest possible sum of a Zizag sequence starting from top and ending at bottom .
function largestZigZag ( mat , n ) { for ( let i = 0 ; i < MAX ; i ++ ) { dp [ i ] = new Array ( MAX ) ; for ( let k = 0 ; k < MAX ; k ++ ) dp [ i ] [ k ] = - 1 ; }