Https://ide.codingblocks.com/s/220168 mixtures

Getting only 2 correct answrers.

@Adarshrajpandey,
That is because you are not filling up the dp table in the correct order, for e.g for filling up dp[1][3] you would need correct values of dp[1][1],dp[2][3], dp[1][2],dp[3][3], but you are filling row wise so you won’t have values of dp[2][3] and dp[3][3], they will just be 0, which would result in wrong answer.