Skip to main content

Time Complexity · #60 · 2026-06-03

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.

A and B are n×n matrices. What is the time complexity?

def multiply(A, B):
    n = len(A)
    C = [[0] * n for _ in range(n)]
    for i in range(n):
        for j in range(n):
            for k in range(n):
                C[i][j] += A[i][k] * B[k][j]
    return C

Loading your progress...

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