57
veky
22 48 64 Leader of the month
44676/ 53887
Last seen 12 hours ago
Member for 11 years, 6 months, 24 days
Difficulty Advanced
We shall not cease from exploration, and the end of all our exploring will be to arrive where we started and know the place for the first time.

Best reviews / Newest reviews
Recursive-PitiHoubi
"if (len(data) > 0)" is just "if data" data[1:len(data)] is just data[1:] And your whole algorithm is just functools.reduce And in fact already written in Python core, as "sum" builtin. More
First-gres_18
You could have written list(list(list([a,b]))), the effect would be the same. :-P More
First-newdazhu
Straightforward. Not very funny, but ok. More
First-Maj
";" might be funny if everything else was in C style, but "sum" surely doesn't fit there. :-] More
Long string!-tetedemerou
Nice reducing to addition of natural numbers. :-) pattern can be much nicer written using list comprehension: [i in range(b) for i in range(a)]. ;-) More
One line solution-MadHatter
Funny, but: first, Counter is really not needed, max can have key too. And second, tuples can be keys (ordered) - no need for base 42. :-) More
A bit hacky-qria
Cool. :-) Expecially three way ^. :-) More
972 liner-Juge_Ti 1
ROTFL. How much time did it take? :-) More
First-marshall.zheng
You're reinventing the wheel. See Counter in collections module (standard library). More
dict FTW-veky
If you're trying to see how it works: just print(r) between lines 5 and 6. I'm sure you'll see what r is, and then the rest is pretty obvious. (Of course, if there are any questions, just ask.) More
__-Cjkjvfnby 1
Cool. O(2) instead of O(7). :-DD More
Sunflower-veky 2
Let's see who will get the sunflower reference. ;-) More
Rec-Lambda-Zanzacar 2
Doesn't work on empty list. checkio=f=lambda x:x.pop()+f(x)if x else 0 would be better. ;-) More
First-Amachua
That's the algorithm I used. Thanks for writing it in long form. :-) More
Greedy-gflegar
Meh. You could do much better if you were a bit bolder. :-D Maybe even find a closed formula. ;-P More
Bunny's simplified-nickie
Yes, cool. While I was obsessed with canonical representation of lines, you rightly saw that all that was needed was \_\_eq\_\_ on them. More
First-htamas
Nice usage of Zeckendorf's theorem. ;-) BTW it would be more scary without that friendly looking boo-ghost. ;-D More
Having fun with for/else-Bilou06
I think this is the first time I've seen an unconditional break at the end of the loop. :-) BTW you don't need line 28, Python is smart enough to return None if there is nothing to return. ;-) More
Second-ciel 1
Better, but still not universal. Where previous worked for under 2\*\*32, this one works under 2\*\*100. :-] Python's recursion is not a way to code iteration. http://neopythonic.blogspot.com.au/2009/04/final-words-on-tail-calls.html More
Third-ciel
Someone has added precondition. So all of your previous codes also work. Sorry. Yes, this one works for all nonnegative m and n. More