Initialising dp table values - 1 represents subproblem hasn 't  been solved yet
for ( int [ ] [ ] row : dp ) { for ( int [ ] innerRow : row ) { Arrays . fill ( innerRow , - 1 ) ; } } ; return calculate ( 0 , 0 , 0 , k , n ) ; }