Write a recursive definition for generating all combinations of length k from an array of distinct numbers. Include a terminal condition and dead-end condition.
For the dead-end condition, think about what numbers we should or shouldn't add to our current combination to reach a length of k.
For example, imagine we have a partial combination of [2] when considering our example array of [1, 2, 3, 4] and k set to 2. We shouldn't create a combination of [2, 2]. This isn't a valid combination. Nor should we create a combination of [2, 1], as we've likely already found the combination [1, 2]. What numbers should we consider adding to our partial combination of [2]?