Never mind, I found out how to do it, but it appears that your answer is wrong?

So I think we might use the hockey stick thereom thing...

it's C(n+k-1, k-1).

So if the twins each get 0, we have 6 candy, 6+(5-2)-1 = 8. 5-2-1=2. C(8,2).

We also get C(6,2), C(4,2), C(2,2), and c(0,2) with increasing values

Adding these together we get 50.