Subset sum
Every number is either left out or taken. A call (currIndex, remSum) tries both branches — that's the inclusion–exclusion tree — and dp[currIndex][remSum] remembers each answer, so a repeated call returns at once. In the tree a box shows remSum with a jar of what is still to make, its row is currIndex, a take branch shows the number taken out, and an ✕ marks a call that can't make its sum.