45
Valentin Bryukhanov
http://bryukh.com/
Last seen 2 years ago
Member for 11 years, 7 months, 24 days
Difficulty Normal
Developer, engineer and taskMaker.
Thanks. This is the original solution and interesting method with rotations. It's something new.
More
My first thought was - "Hm, it's my solution. Maybe I clicked a wrong link." :)
More
for i in range(len(data)):#Filling up the binary matrix with 0's and 1's
for j in range(len(data[i])):
You can replace it with
for row in data:
for el in row:
The line 8 can be reworked in the follow (this is easy expanded)
if data[i][j] in 'GS':
Is you
More
The nice trick!
lambda x:"+"*x+"-"*-x
I like it -- something new and not obvious.
More
In this task you have not to search the shortest way. So you don't need min(self.routes). But if you want the shortest way, then i recommend you to look at another algorithms (Dijkstra, BFS, A* search)
More
At first look i thought "This is not a puzzle. I see indents and docstring. It's clear solution and Veky didn't write it" :)
But then... You broke my brain. Now i have the puzzle for weekend.
More
I didn't get why do you use "*a" here. A input tuple become
a == ((data),)
and then you unwrap it again.
list conversion are redundant -- "sorted" can work with tuples too.
And
"lambda x: abs(x)" is the same as "abs". So you can use "key=abs".
P.S. PEP8 is a good choice for "Clear" ca
More
Good. Only one remark - 'l' is the bad name for variable, because it very similar to "1" for some fonts. Without syntax highlighting it can complicate the code reading.
More
I can not see the author of this solution, because I use Random Review. But it looks like mine -- the same mistake with "except".
More