DP table to store the computed subproblems
int [ , ] dp = new int [ arr . Length + 1 , target + 1 ] ; for ( int i = 0 ; i < arr . Length + 1 ; i ++ ) { for ( int j = 0 ; j < target + 1 ; j ++ ) { dp [ i , j ] = - 1 ; } } for ( int i = 0 ; i < arr . Length + 1 ; i ++ )