31
Last seen 3 years ago
Member for 6 years, 6 months, 21 days
Difficulty Normal
Nice and clear. I used the same method and convert it into a 1-liner. Less
readable on one single line.
More
I love the idea of using eval to delay computation of values and therefore
avoid computing not define formulas
More
Challenge accepted, here is my solution [mikael.desharnais' challenge](https://py.checkio.org/mission/matrix-pattern/publications/Ylliw/python-3/mikaeldesharnais-challenge/)
To make it shorter, I have:
- replace all nested 'for' loops by a for x,y in product(xx,yy) like:
for rI in range(rI
More
Very nice OOP solution indeed, i like the approach.
More
I used the exact same idea, but kept track of everything along the path. Deque is reducing memory consumtion. With time in mind, a set() instead of a dict() for table is better as you don't need to keep track of 'step' value.
More
S='!$&) #&(+ %(*- ),.1 +.03 -025 1469 368; 58:= !#$(,013 #%&*.235 )+,0489; +-.26:;= !#%$*,24:9;='
checkio=lambda a:sum([set(x)<=set(chr(x+y+30)for x,y in a)for x in S.split()])
More
Not exactly an elementary mission in my view, even if I did not need 5 hours, it was definitely not that easy for me too.
More
Thanks [kurosawa4434](https://py.checkio.org/user/kurosawa4434/), that's a great mission and it was very interesting to solve it.
More
I learn a lot of great ideas that i did not think of using: operators,
partial
Nice and clear solution.
More
Nice 2 passes loop idea with the for modify in 0,1. I would suject to test 'modify and recog' before the for y_rel loop, that way you avoid looping if it's not necessary (not recog). As well from the 2 lines in the inside: 'recog &=...' and 'image[y][x]=...' only one should be executed based on 'mod
More
À bit overkilll for such simple task but very interesting use of the min
function with lambda.
More
Congratulations for solving this difficult problem.
Like you, it took me a lot of trials and errors. Several working codes were far too slow to complete on the web server.
I finally took the approach to maintain for each position the list of possible successors and possible predecessors (from the ra
More
I enhance my solution to make it a 2-liner (2 lambda), you may want to look at it, it's quite nice and exactly use this way to solve the problem.
More
Nice code, you can make it shorter by using one nice Python trick: you can
sort by tupple, first value will sort, second will be use only if first is
identical, then third, then fourth, etc.
2nd trick, if you sort numbers, sorting by opposite value means sorting
reverse.
So here, you can sort by:
1/
More
Congratulations for solving this difficult task.
I tried to understand your code, but failed.
Can you give me some explainations of your strategy? It looks quite different from mine, provide the results at about same speed, so I would like to understand it.
More