57
Awesome Team
Vedran Čačić
https://web.math.hr/~veky
Last seen 13 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.
By "it" you mean the mission, or your solution? :-)
More
It's very awkward how you handle the case when item is a number. I really think it is convoluted code.
More
Isn't `.split(' ')` the same as `.split()`? And isn't `int(blah, 0)` the same as `int(blah)`? Remove those arguments and see. ;-)
More
I already did that. They told me one of those method calls is unnecessary. Try to figure out which one. :-D
[spoiler]https://py.checkio.org/mission/conversion-into-camelcase/publications/veky/python-3/title-is-awesome/?ordering=most_voted&filtering=group[/spoiler]
More
What do you think lines 13~17 accomplish? I'm quite sure you're wrong. :-]
More
Now you have `re.findall('-?\w+', '2')` problems. :-P
BTW, why `\w`? You expect to find `nan` there? :-]
More
Since you factored out that much, you could have done it all the way. :-P
More
Very nice and factored. The only thing left is that _previous_next could
use turn_channel instead of duplicating the code to return the value.
More
Sorry, this is not a 46-liner. This is a paper of 24 lines concatenated to a 18-line algorithm. ;-D
More
If you're going to write result_string += '', then you should also write
redundantly lock = 0 when it's already 0 and so on. :-]
More
Very inovative, but surely not clear. And it's not that you actually gain
anything: since you have to calculate and compare distances for two
neighboring items, you could just calculate and compare them for all items.
You'd have a linear algorithmic instead of linearithmic sorting one. :-9
More
I'm not quite sure what are you trying to accomplish. You practically torture Python with your horrible pile of symbols, as if you try to golf, but on the other hand, you miss so many obvious optimizations in that regard. (No, I'm not talking about my `-s%10`.:) For example,
(lambda d: abominat
More
You have a weird definition of short. :-D
And 'clear' could also be discussed... taking a simple and intention-clear expression `a ^ b <= c` and naming it `get_count(a, b)` (`get` is a nonword for function names, `count` is surely completely orthogonal to what the function does) is really head-scra
More
Nice (though could be simpler, of course), but the asymmetry between handling hour and minute (oops, time[1]:) is kinda odd. I think better would be
hour, minute = map(int, time.split(':', 1))
More
Nice regex formation. :-D But seriously, some other things might be
improved a lot. String methods, especially .isupper and .endswith, should
be considered.
More
It seems really hard to write an O(n^2) algorithm for this mission, but you've managed that. ;-[
More