Time Complexity · #56 · 2026-05-30
What's the Big-O?
Python ·Difficulty 3/3
How to play
Read the code and pick its time complexity from four Big-O choices. Think about loops, recursion, and hidden costs. Press 1–4 or click to answer.
n = len(nums). What is the time complexity?
def subsets(nums):
result = [[]]
for num in nums:
result += [s + [num] for s in result]
return result
Loading your progress...
Press 1 through 4, or tap a numbered choice, to answer. Back to hub