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.
Find the two most distant points
Replace Vector Elements
Given a window, how many subsets of a vector sum positive
How many ways to write
odd number odd sum
Choose group with people
Find the number of rectangles
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