text: table [ i ] will be storing the number of solutions for value i . We need n + 1 rows as the table is constructed in bottom up manner using the base case ( n = 0 )
code: int table [ n + 1 ] ; memset ( table , 0 , sizeof ( table ) ) ;