Loading...
Loading...
Loading Curriculum...
Loading Subject...
Loading Topic...
Loading Lesson...
Loading Lab...
In competitive programming, results are often required "modulo 10^9 + 7" to prevent integer overflow and keep the numbers within a standard range.
In many languages, `-1 % 5` returns `-1` instead of `4`. To fix this, always use `(a % m + m) % m` to ensure the result is non-negative.