The Cost of Loops

Talk it through with a coach who asks guiding questions and gives hints until you reach the answer. Pass to mark the challenge as completed.

The problem

  • easy
  • Pro

Talk through how to work out the time complexity of code built from loops: one loop over the input, two loops one after the other, one loop inside another, and a loop that halves its counter each time.

Talk this problem through with an AI coach

This is a Pro challenge. Sign in with Google, then upgrade to start a voice session.

Start free →