A 2D table where entry eggFloor [ i ] [ j ] will represent minimum number of trials needed for i eggs and j floors .
let eggFloor = new Array ( n + 1 ) ; for ( let i = 0 ; i < ( n + 1 ) ; i ++ ) { eggFloor [ i ] = new Array ( k + 1 ) ; } let res ; let i , j , x ;