Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【js】如何高效的实现从m中选n个数的条件组合函数 #26

Open
henryyohn opened this issue Oct 22, 2019 · 0 comments
Open

Comments

@henryyohn
Copy link

从m中选n个数出来按条件组合
1、考虑顺序和不考虑顺序
2、一个组合中,允许有重复元素和不允许有重复元素
如从0,1,2中选2个数
1、考虑顺序允许重复:[0,0],[0,1],[0,2],[1,1],[1,2],[2,2],[2,1],[2,0],[1,0]
2、考虑顺序不允许重复:[0,1],[0,2],[1,2],[2,1],[2,0],[1,0]
3、不考虑顺序允许重复:[0,0],[0,1],[0,2],[1,1],[1,2],[2,2]
4、不考虑顺序不允许重复:[0,1],[0,2],[1,2]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant