# Is this problem hard? Finding all the subsets of size k from a sequence of n numbers

I want to know the hardness of finding all subsets of size k from a sequence of n numbers. There is an algorithm based on recursion: Print all possible combinations of r elements in a given array of size n.

However, I am not sure whether this can be done in polynomial time or not.

For fixed $$k$$, the running time is polynomial, but if $$k$$ is part of the input, the running time is not polynomial. The number of such subsets is $${n \choose k}$$, which is very roughly like $$n^k$$. Thus, if $$k$$ is fixed to something like 3, this becomes $$O(n^3)$$ -- polynomial. However, if $$k$$ is part of the input, the running time is exponential in $$k$$.