Understand the topic

Big O tells you how the work grows when the input grows. You don't count exact steps, you count the shape: one loop over n items is O(n), a loop inside a loop is O(n²), and halving the input each step is O(log n).

The problems here are easy on purpose. Solve each one, then say its time and space complexity out loud before you submit. Where the brute force and the smart answer differ (good pairs, smaller numbers), feel the difference between O(n²) and O(n).

Work top to bottom — each list goes from easy to hard. Try a problem for at least 15 minutes before opening a hint. Ticks are saved in your browser.