We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
原题链接
使用回溯法进行解题,在回溯的常规操作下注意以下两点:
i + 1
const combine = function(n, k) { const res = [] const helper = function(start, cur) { if (cur.length === k) { res.push(cur.slice()) return } for (let i = start; i <= n; i++) { cur.push(i) helper(i + 1, cur) cur.pop() } } helper(1, []) return res }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
原题链接
回溯
使用回溯法进行解题,在回溯的常规操作下注意以下两点:
i + 1
来进行剪枝。The text was updated successfully, but these errors were encountered: