3 ms·
For 11 the even faster method is to just do this: 678101 -> 6-7+8-1+0-1 = 5 -> no bueno 874632 -> 8-7+4-6+3-2 = 0 -> divides by 11 The exact same idea
by eps 6y ago
For 11 the even faster method is to just do this:
678101 -> 6-7+8-1+0-1 = 5 -> no bueno
874632 -> 8-7+4-6+3-2 = 0 -> divides by 11
The exact same idea, but even less "state" needed as you put it.
- dmurray 6y agoThink you're doing the exact same as me but I started from the right. 1-0+1-7+8-6. This way you end up with the remainder mod 11, if you start from the left you sometimes need to flip the sign at the end.