38
juestr
17 44 52 Leader of the month
8704/ 9195
Awesome Team Jürgen Strobel
Last seen 12 hours ago
Member for 5 years, 1 month, 1 day
Difficulty Normal
Best reviews / Newest reviews
8-liner: cleanest recursive-przemyslaw.daniel 3
Very nice. In the if-branch **dice_number can be removed since it is known to be 1. More
regex, 7 lines-kdim 2 1
That's a rather _creative_ solution. More
all-kurosawa4434 2 1
Strictly speaking since `items` is an `Iterable` we shouldn't use `[]` on it. (The tests are bad.) More
Casting out nines II-amandel 2 1
You could replace the first inline-if too: return num and (num % 9 or 9) More
Memento pattern.-Anton_Prokopovich 1 1
I don't see the Memento pattern here. The Text class has no method returning its state. The Memento pattern is about encapsulating the the logic to create and restore internal state via an opaque data object (=Memento) in the originating class, see the WikiPedia article. More
Batteries!-veky 1 1
I thought about this too and it works atm, but maketrans is not defined for the case of an inconsistent mapping. Future or other python implementations may raise an Exception without warning, and I'd rather call it creative for that reason. https://docs.python.org/3/library/stdtypes.html?highlight= More
heapq-Sillte 1 1
IMHO State has a lot of boilerplate over just using a tuple, @dataclass at least would reduce this. Search would be more efficient if State.__lt__ also includes len(remains) as a tie breaker for states closer to the goal. More
The Hiden Word-colinmcnicholl 1 1
A few suggestions: - ```for row, line in enumerate(lines)```, manual counting isn't very pythonic - shortcut returns directly in the for loops would be good here, no need for the 4 result vars at all, and wasted effort to continue after finding a match - transposing with zip_longest is neat, but you More
First-johan4622 1 1
Hint: there are std _builtin_ functions for max and sum. More
Math-Olpag 1
Nice. For degenerated triangles it should also return 0,0,0, so I think it should be a+b < c etc. in the guarding if. More
quarkov-quarkov 1 1
Nice, I felt changing the const arrays was cheating, but it really makes it much simpler so why not. More
recursive search (DFS)-Sim0000 1
Nice solution overall. The range checking if statement could be improved in readability by using python's great chained comparison feature 0 < x <= xsize etc although you might have to negate the whole thing, or rearrange the following for statement. More
Use Numpy matrixes-U.V 1
Using a bit more from numpy you could vectorize everything in this mission. E.g. `numpy.subtract.outer` on points basically replaces your 2 outermost loops, it creates a matrix using a full outer join with pairwise subtraction for all points. More
First-IPK 1 1
This is not speedy, it's doing 2 nested loops over weights, for a O(n^2) solution. This can be done in O(n). More
First-yield...-Sillte 1 1
Index-based iteration is non-pythonic. This is much easier using language features properly, like str.split() or regular expressions and iteration with for. More
st_re_ssful-Tical_1000 1 1
```if COND return True else return False``` can be trivially shortenend to ```return COND```, or ```return bool(COND)``` if COND is not of type bool already. More
First chr + ord-LeonidPK 1 1
Separation of coordinate conversion and checking logic in int coordinates would make this both easier to read and possibly faster. More
First-alexandrov.net 1
Ha I missed how the strings can be compared safely, else I did the same with key=. More
First-mozurin 1
```zip_longest``` would have a convenient ```fillvalue='\0'``` keyword. More
First-xxxxxxxx 1 1
Using // (floor division) instead of / you wouldn't need to do conversion back to int. More
1
2 3 4 5 6