Given two positive numbers n and k, where n>=k. In how many ways can we write n as sum of k positive numbers. Same numbers but different orders are considered different.
For n=5, k=2 the answer is 4.
5 = 1 + 4
5 = 2 + 3
5 = 3 + 2
5 = 4 + 1
please correct the reference solution to com(x,k) instead of com(x)
Please correct test cases, the function should have 2 arguments.
Back to basics 15 - classes
Rotate a Matrix
Calculate the Hamming distance between two strings
subtract central cross
Divide by 4
Choose group with people
How many ways to write
Find the number of rectangles
odd number odd sum
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office