🎓How I Study AIHISA
📖Read
📄Papers📰Blogs🎬Courses
💡Learn
🛤️Paths📚Topics💡Concepts🎴Shorts
🎯Practice
🧩Problems🎯Prompts🧠Review
Search

Concepts3

Category

🔷All∑Math⚙️Algo🗂️DS📚Theory

Level

AllBeginnerIntermediateAdvanced
Filtering by:
#modular arithmetic
⚙️AlgorithmIntermediate

Modular Arithmetic Pitfalls

Modular arithmetic is about working with remainders, but programming languages often return negative remainders, so always normalize with (a % MOD + MOD) % MOD.

#modular arithmetic#modular inverse#fermats little theorem+12
⚙️AlgorithmIntermediate

Overflow Prevention Techniques

Integer overflow happens when a computed value exceeds the range of its type; in C++ this silently wraps for unsigned and is undefined for signed, so prevention is crucial.

#overflow prevention#long long#__int128+11
⚙️AlgorithmIntermediate

String Hashing (Polynomial Hash)

Polynomial string hashing encodes a string as a base-p number modulo a large prime, letting us compare substrings in O(1) after O(n) preprocessing.

#string hashing#polynomial hash#rolling hash+12