Given an integer n, write a function to return all possible combinations of k numbers out of
Fantastic news! We've Found the answer you've been seeking!
Question:
Given an integer n, write a function to return all possible combinations of k numbers out of the range [1, n]. You may return the combinations in any order.
For example, if n = 4 and k = 2, the function should return [[1,2],[1,3],[1,4],[2,3],[2,4],[3,4]].
Related Book For
Modern Portfolio Theory and Investment Analysis
ISBN: 978-1118469941
9th edition
Authors: Edwin Elton, Martin Gruber, Stephen Brown, William Goetzmann
Posted Date: