How many ways to divide people into groups
Anonymous User
852

Given the number (m) of people and divide them into n groups. How many ways to divide?

Example:
m = 5, n = 3
[1, 1, 3], [1, 2, 2] ([2, 1, 2] is not valid because it is duplication of [1, 2, 2])
So return 2

m = 8, n = 4
[1, 1, 1, 5], [1, 1, 2, 4], [1, 1, 3, 3], [1, 2, 2, 3], [2, 2, 2, 2]
return 5

Comments (1)