Complexity quiz

Read code and call out Big O clearly.

Choose both time and space complexity, then compare against the interview-style explanation.

Single Loop

1 / 20
let total = 0;
for (const num of nums) {
  total += num;
}

Time complexity

Space complexity