4 ms·
Nice to see some experimentation. :) I tested all 2^31 non-negative integers, which is 2147483648 values. If I remember correctly, the value that was wrong was
by lambda_cube 15y ago
Nice to see some experimentation. :)
I tested all 2^31 non-negative integers, which is 2147483648 values. If I remember correctly, the value that was wrong was large, probably between 2^30 and 2^31. Java is pretty fast and I think this took tens of minutes. Python is about 20 times slower so it may take hours for you.
- zxw 15y agoYeh it's fairly slow going. I'm at 3,706,382,752 and am going to call it a day. Looks like the code works properly.