Lesson

Math & Number Theory

GCD, primes, modular arithmetic, and constructive counting.

Easy → HardTime O(√n)–O(n log log n)Space O(n)
Practice problems
Loading visualization…

Loading solution…

Must-know

Euclid GCD, fast power by squaring, sieve of Eratosthenes, and careful overflow/modulo handling.

Pitfalls

  • !Integer overflow
  • !Division by zero
  • !Floating precision for geometry

Practice from this topic

Showing 24 of the related problems in the 1000-question bank.

View all →

Got the lesson?

Mark Math & Number Theory as understood when the ideas stick.