31
Last seen 3 years ago
Member for 6 years, 7 months, 4 days
Difficulty Normal
Nice solution for category 'Clear', but is it fast (category 'Speedy')?
More
Are you sure that magic=3 works with any kind of topology?
More
Very interesting, the age function is quite complex, a simple comparison of
the year was sufficient as it was January 1st. Still this version is very
impressive as it would work with any other date.
More
Thanks a lot for this very interesting mission and also for this great solution.
I like the idea of combining what you call brute_force which looks more like obvious_short_paths too me and the other function.
I am unsure you needed to set to '3' the limit between small/big paths. You can probably j
More
Great ideas and nice code.
A few enhancements proposal:
acceptableSquares[len(acceptableSquares)-1]
In Python, you don't have to compute the length to get the last
element: acceptableSquares[-1], which is shorter and more efficient.
if len(acceptableSquares) > 0
Here as well, a list is True as
More
Great idea, python sort allows you to use tuples so you can just put you
two criterias one after the other: (-items.count(i), items.index(i))
More
I like the double use of the 'type(data) is list' to generate the default value
More
Use of 'hypot' from test code is a bad idea.
With some values like (6,9), (9,0) and target (0,2), the result is incorrect:
distance( (6,9) to (0,2) = sqrt(6^2+7^2)=sqrt(85)
distance( (9,0) to (0,2) = sqrt(9^2+2^2)=sqrt(85)
so distances are equal but
hypot(6,7)=9.219544457292887
hypot(9,2)=9.21954445
More
This is fast, but it fails sometimes.
When I test it with all possible combinations, first fail was with goal in (0,9) and start in (2,0),
More
After reviewing the very nice solution of [Flpo](https://py.checkio.org/mission/colder-warmer/publications/flpo/python-3/first/), I wanted to clean my code using the operator ideas.
I also wanted to make the code faster as I was disapointed that trying to 'think' to a good candidate turned to be slo
More