dsa8 min read
Modular Arithmetic Explained — Binary Exponentiation, Modular Inverse, Fermat's Little Theorem [LC 50, Google, Stripe]
Modular arithmetic powers nearly every competitive programming problem and is foundational at Google, Stripe, and any system that handles big numbers. Master binary exponentiation in O(log n), modular inverse via Fermat little theorem, and the modulo identities that prevent overflow on the hot path.
Read →