Skip to main content

Time Complexity · #25 · 2026-04-29

What's the Big-O?

Python ·Difficulty 1/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.

What is the time complexity?

def is_prime(n):
    if n < 2:
        return False
    for i in range(2, int(n**0.5) + 1):
        if n % i == 0:
            return False
    return True

Loading your progress...

Press 1 through 4, or tap a numbered choice, to answer. Back to hub