11 n 1 C 1 0 1 C 1 1 1. N-r1 r r-1. Number of ways to write N as a sum of K non-negative integers.
For example your function should return 6 for n 4 and k 2 and it should return 10 for n 5 and k 2.
10 C 2 is 45 and 45 13 is 6. Below is the required implementation. Following implementation uses above formula to calculate C n k. Number of ways to write N as a sum of K non-negative integers.