Command Palette

Search for a command to run...

Module 1

Big-O and Complexity

How to tell, before running anything, whether a solution will be fast enough, and how to read a problem's limits to know what speed it needs.

Beginner 4 lessons 2 problems ~50 min of lessons

Every problem in this course is judged on two things: is it correct, and is it fast enough? Big-O is the language for "fast enough". It describes how the work grows as the input grows, so you can compare ideas on paper before writing code.

The most useful skill in this module is reading constraints: when a problem says n ≤ 10⁵, it's quietly telling you that O(n²) will be too slow and O(n log n) will pass.

Best after: Java for DSA

Part 1

Learn the ideas

Part 2

Solve the problems

In order of difficulty. Each one shows the pattern it teaches.

  1. The simplest O(n) algorithm: one pass with one variable. Also why sorting first (O(n log n)) is wasted work.

  2. The classic three-step speed-up: O(n²) all pairs → O(n log n) sort → O(n) hash set, and how to pick by constraints.