Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Actually, this is the top solution to an old anagol challenge by golfing legend xnor :).
Here is the original one, and honestly, I have no idea how he came up with such an intricate formula. The
^
and~
seem rather unuintuitive, making me think that he used brute force, perhaps with a little bit of mathematical insight. I've attempted to reproduce his magic formula using brute force, and interestingly I get no results if I omit either the^
or~
operators. Yes, it is truly magic :PUpdate: I've managed to trim it down to 51 bytes.
2nd Update: 2 more bytes golfed, 49 bytes now.
3rd Update: Shaved off yet another two, down to 47 bytes.
You'll want to check out Lynn's pysearch tool (this is what I used to find the formula). There exists a few subtle bugs, but otherwise it's fast and pretty reliable to use.
This comment is hidden because it contains spoiler information about the solution
Python 3 is now allowed.
The tiny random tests have less test cases than the large ones. Also, those tests appear to only have one test to reduce the lag. Ten million test cases might crash the browser.