Which one has a Better Time Complexity

Does the Recursive one have better tc or the bitset one? Which one is ideal to be implemented in a interview?

hello @JaveedYara
both the solution has same time complexity.
but the iterative version is bit efficient because in that we do not use any extra space(in recursion system stack is get used).

go with recursive one