educative.io

Educative

Why are we ignoring output space here but considering the same for "subsets" pattern section of this course?

Why are we ignoring output space here but considering the same for “subsets” pattern section of this course?

What it meant to say is “IF we ignore the space used for the output array” then the space complexity will be O(N). Otherwise, the space complexity is similar to the subset problem, as it will be higher.

For a tighter bound of such problems take a look at nPr and nCr. Here is a good read: https://www.quora.com/How-do-I-differentiate-between-formulas-of-NCR-and-NPR/answer/Sean-Fife-1