~/problems
Problems
Basics first, then the classics, then company-style assessments. Every problem has tests you run right here; multi-level ones unlock as you go. See the roadmap.
Advanced & competitive
Number theory
Modular arithmetic, primes, matrix powers.
17 problems
Advanced & competitive
Number theory Modular arithmetic, primes, matrix powers.
Modular arithmetic
- Play first: The Power-Up 1-minute game Fast exponentiation
- Dividing under a prime modulus basics py · c++ · java easy
- Yeast growth over a range of hours py · c++ · java easy
- Inverse modulo a prime py · c++ · java easy
- Modular exponentiation code the boss py · c++ · java easy
- Power with a huge digit-list exponent py · c++ · java medium
- nCr mod p for many queries py · c++ · java medium
Primes, divisors and GCD
- Play first: The Brick Towers 1-minute game Euclid's algorithm (GCD)
- All divisors of a number basics py · c++ · java easy
- Festival lanterns blinking together py · c++ · java easy
- Split a deck into equal groups py · c++ · java easy
- Greatest common divisor (Euclid) code the boss py · c++ · java easy
- Prime factorization py · c++ · java easy
- Count Primes ▶ boss game py · c++ · java medium
- Divisor counts for many numbers py · c++ · java medium
Matrix exponentiation
- Matrix multiply and matrix power basics py · c++ · java easy
- Huge Fibonacci numbers mod p py · c++ · java easy
- N-th Tribonacci Number py · c++ · java medium
- Seed library with donations py · c++ · java medium