We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
That is the property, yes, but you can remove the first two modulos because a) x is between 1 and 1000, so x modulo 1234567 is pointless, and b) modulo-ing sum before it is used in the equation and before assigning the result back to sum is redundant.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Connecting Towns
You are viewing a single comment's thread. Return to all comments →
That is the property, yes, but you can remove the first two modulos because a)
x
is between 1 and 1000, sox modulo 1234567
is pointless, and b) modulo-ingsum
before it is used in the equation and before assigning the result back tosum
is redundant.