← Back to challenges

Modular Arithmetic (Part #4)

PythonHardmathalgebrabugs

Instructions

Modify the inefficient code in the Code tab so it can pass the tests.

Examples

mod(7, 6) ➞ 0

mod(8, 6) ➞ 0

mod(9, 6) ➞ 0

mod(32345453245, 25433) ➞ 10232

Notes

  • The variables will be natural numbers.
  • If the loop has to sweep the entire range ran it will overload.
python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.