Please check this site for more information..
https://www.tutors4you.com/permutationco ... torial.htm
Let's take 2,3,0,0 combination. Here the possible numbers where sum = 5 are
23, 32, 230,203,320,302,2300,2003,2030,3200,3002,3020.
Here all numbers less than or equal to 9999 are asked. So the problem becomes how to arrange 2,3,0,0.
Here 0 can still be the thousand digit and hundred digit ( true in case of 23 and 32)..
ABCD ==>No. of ways of filling digit A is 4(can be 2,3,0,0)=4
No. of ways of filling digit B is 3 (remaining numbers after A is chosen)
No. of ways of filling digit C is 2(remaining numbers after A and B are chosen)
No. of ways of filling digit D is 1(last number remaining)
Total number = 4*3*2*1/2. (Divide by 2 since there are two zeros. Using any of the two will result in same number)
==>12.
Same approach for other combinations as well.
Hope its clear.
