57
Awesome Team
Vedran Čačić
https://web.math.hr/~veky
Last seen 15 hours ago
Member for 11 years, 6 months, 6 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.
You're going overboard with European Association of Fish Pathologists. Generalizing case n=2 is not really productive. And beating someone to death with a loaded uzi is really not fun. :-P Look, your lines 10~17 can be:
if "XXX" in candidates: return "X"
if "OOO" in candidates: return "O
More
Duuude. :-]
Just one nitpick: line 31, please learn about >2-arg form of map. It could come handy. ;-)
More
You could have avoided all that boilerplate with
import functools, re
checkio = functools.partial(re.match, r'...your wonderful regex...')
More
First a puzzle: that duplication in lines 19 and 6 really stands out. Can you trivially change your code to eliminate it? :-]
And now for the usual nitpicking:
* Line 4 could (should?) be: if x == y == 10.
* That list of lists of tuples and strs really should be a dict. It has .items() meth
More
Hm, this gives me some [idea](http://www.checkio.org/mission/digit-stack/publications/veky/python-3/pointless/)s... :-]
More
About that horrible line 17, I think I have good news for you: tuple comparisons.
(a, b) < (c, d) <~~~> a < c or a == c and b < d
You can also learn about key argument to min and max.
More
> The shorter your code, the more remarkable you are.
Then I am https://remarkable.com/ :-D
More
_This_ you call clear? And you're telling me my solutions aren't clear? Man, I hope you're just a troll...
Rebinding a builtin name, unnecessary list comprehension, totally pointless comment, masquerading bound method as a staticmethod... there are more headaches than lines in that code. :-(
More
This one made me laugh. :-D
Though, do you really think line 2 does something? How is splitWords eaiser to understand than words.split()?
More
Ha, that one was obvious, this one not really. Though I'm not sure whether that should be worth more or fewer thumbs... Ok, have your five, you scrooge. :-P
More
You don't need "+" in your regexen (you even don't have it in the first one:). And you don't need r here, though maybe it is good to always write it to remind you of regex parsing. But the last one then really ought to be \d. ;-)
Also, you don't need bool around the first condition, and even on the
More
Nice reorganization into tens and dups, but the code has some horrible duplication. You can do much better. ;-]
Here is an interesting approach, that tries to stay faithful to your algorithm. Of course, if you're willing to depart a little from your original algo, you'll be able to write much bette
More