text: lookup [ i ] [ j ] is going to store minimum value in arr [ i . . j ] . Ideally lookup table size should not be fixed and should be determined using n Log n . It is kept constant to keep code simple .
code: var lookup = Array . from ( Array ( MAX ) , ( ) => Array ( MAX ) ) ;