Modular Arithmetic (Part #4)

Published by jota in

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.
Watch a quick demo on how Edabit works.