13
grutte_pier
11 24
743/ 845
Jakob van Bethlehem
Last seen 5 years ago
Member for 10 years, 4 months
Difficulty Normal
Best reviews / Newest reviews
All the "any"'s-ogre
The explicit _bool()_ conversion can be removed, as you are already working with booleans More
Second-luvs
Much better than your first :D More
First-tarasenkoa 1
Did you forget to remove the 'debug-prints'? More
Solution to Problem 1-erick.kusnadi.75
I came up with the same idea, so I like it (+1), except that you destroy the input list. I don't think the users of your code expect that to happen (-1) ;) More
First-ricardo0y 1
Why not _sub('[a-z]', '', text)_ ? More
duh, not nice, but working-karel_chajim
Why do you call it not nice? What would you rather have written different? More
for else-veky 1
Hm, somewhere in the back of my mind I knew of this _for-else_ construct. But in this particular case I don't think it does anything, does it? Or in other words: if you would remove the _else:_, and just type _return False_ as the last line, nothing would change, would it? More
First-abaletinskikh
Python is no bash - please don't use capitalised variable names More
First-IlyaM66
I tried a EAFP approach first as well, until I realised that a negative index is not a problem in Python. Then I had to change it to something that more or less does the same as your solution, except that I used some different constructs. What I don't like about this particular implementation is th More
First-RomanLubyanoy
There are quite a few things here that could use improvement: * Don't set _r_size = len(grid) -1_ and then do _i <= r_size_. Rather just compare _i < r_size_ - this is much more 'standard' in all programming languages that exist * Comparing a boolean value against _False_ is as bad as it gets, agai More
First-AlexGiesbrecht
Excellent solution, reminding us all of the possibility to add a step to the slice operator More
First-flex
You could skip calculation of the average, because _len(l)_ will be the same for each row, or in other words: _index(max(sum))==index(max(avg))_ More
First-johnarvee
You also destroy the input list - I'm not sure the users of your code were expecting that to happen! More
Xs and Os Referee-tamsayhi
Hm, to me straightforward is not the same as clear - comparing this solution to others, I think the category 'clear' is not quite correct - it should probably be 'creative', as it took me quite a while to figure everything out More
Second-andrew.daniel.walsh
Why adding a default argument to the _checkio_ function - just define marks as the first line in the function body More
First-saktiaish
I don't think you need to call the _data[:]_ syntax a 'trick': it is really just standard Python; used by a lot of code out there when in need of a copy of a list More
First-irvcov
You could actually do _count += is_safe_ :D More
First-bluewaters
You were probably not aware yet of the _**_ operator in Python? See https://docs.python.org/2/tutorial/introduction.html#id1 More
First-Corwine 1
Instead of _reversed(range(a, b))_ you could also use the simpler _range(b-1, a-1, -1)_. And instead of setting the _changed_ variable and checking for it, you could use the _for-else_ syntax More
First-natsuki
I see _return 'D'_ twice .... a clear indication that the algorithm needs improvement More
1
2
3 4 5