Why this is O(n³)
Why O(n³). Three nested loops over n (the side length of the n×n matrices). Each cell of C is the dot product of an n-length row and column.
Sharper algorithms exist. Strassen's algorithm is ~O(n^2.81) and modern theory pushes towards ~O(n^2.37), but every production matmul (BLAS, numpy) uses the cubic algorithm because the constants are vastly better.
How to recognize cubic complexity in the wild
O(n³) shows up in triple-nested loops (matrix multiplication, certain dynamic-programming tables, Floyd–Warshall). Rare in idiomatic application code but common in numerical kernels.
The eight rungs of the ladder
Big-O classifies the asymptotic growth of a function, not the wall-clock time. The ladder Bugdle uses has eight rungs ordered from cheapest to most ruinous: O(1), O(log n), O(n), O(n log n), O(n²), O(n³), O(2ⁿ), O(n!). The puzzle's answer sits at rung 6 of 8. The four-guess budget plus higher/lower hints means the puzzle is solvable in at most ⌈log₂(8)⌉ = 3 perfectly-read guesses; the fourth attempt absorbs misreads of the snippet.
Common confusables
Nested loops aren't automatically quadratic — the inner loop has to range over n, not a constant. A loop that always runs ten iterations is still O(1) work per outer iteration. Similarly, a recursive function isn't automatically exponential just because it calls itself twice — if the recursion has overlapping subproblems and you memoise, you collapse back to polynomial. Always ask: what does n really mean here, and how many distinct subproblems are there?
External reference: Big O notation — Wikipedia.