57
Awesome Team
Vedran Čačić
https://web.math.hr/~veky
Last seen 23 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.
The title means many people were solving this together? :-)
You don't need comma after dc in line 5.
And you need space after comma in line 6.
Since you've chosen to go a long way around establishing whether indices are valid, wouldn't it be more relevant to compare nc with len(grid[_nr_]) instea
More
I personally think categories are a waste of time, but the official stance of CiO is that "speedy" should be for code that _executes_ fast. Not one you've cobbled together in five minutes. :-] And this is surely not it. Do you see why?
More
Look at [this](https://docs.python.org/3.5/library/collections.html#collections.Counter). Python has got you covered. :-)
More
Everything up there I can agree with, but scope_control=-5? Surely you mean Python2 then, and you should update your key. :-P There is only one Python, and it has not quite perfect, but surely better scope control. For example, 1. :-)
More
Of course, another view at the [current top solution](http://www.checkio.org/mission/striped-words/publications/RRRQ/python-3/first/).
More
Finally someone who used groupby correctly. :-D
You seem to have big problems with your iterators, since you're always trying to cram them into expressions. And map is not a panacea. :-)
daily_secs = ((int(r[2]) for r in records) for records in daily_records)
Or something like that. :-)
But
More
Not cool because quadratic. And comprehension would probably be simpler. :-)
More
It's almost object oriented. :-D
Mine is much simpler, without special methods with quite trivial implementations, and I think it does the same job. :-=
(Only 2 thumbs since you're writing FORTRAN in Python. But you already know that, probably.:)
More
> Python helps me to stay sane in this crazy world.
Ok, then maybe _don't_ read my solutions. :-D :-]
More
Lines 21~23 are completely deletable. :-] All those "!= 0" also. ;-)
`tens != 0 and tens != 1`: How about `tens > 1`?
Lines 13~14: words.append twice should be words.extend, probably. Or even better, use a generator for much less repetition.
Lines 17 and 19 are character-per-character the same. T
More
But you should use it fully FTW. :-P Check out unicodedata.category and unicodedata.combining. ;-)
More
I'd still like to register my general dislike of eval, but here it's overweighted by elegance of this solution. Congratulations, you win one of Veky's fives! :-)
And yes, I find it funny that you call it golf, and then use spaces as is proper. :-) As if you're saying, "this is _so_ short, I can spr
More
Yeah, you should. :-D For start, study for-else loop. Much better than this insane flag manipulation.
More
words.split() would probably be better.
Also, spaces. num += 1 and num = 0 are really much clearer, especially since you wrote it that way in line 2.
More
Don't comprehend into a list if you don't need a list as a whole, just numbers one by one (and sum expects exactly that). You save memory, and reduce line noise.
sum(item for index, item in enumerate(array) if not index%2)
Of course, that particular pattern of indexing is probably better expre
More
That lambda can be written much easier, if you understand Python's object model: it's just str.isupper:
''.join(filter(str.isupper, text))
(BTW ''.join to me looks much nicer than "".join. But that's just aesthetics.:)
More