dp[i][j] - true, if there is a way to have sum j after processing the first i elements, and false otherwise. so transitions wil be: dp[i][j] = dp[i - 1][j] OR dp[i - 1][j - weight[i]], (OR means logical or),first term means that we don't want to use i-th character, second - we use it, so the sum decreases.
-- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
