15
Art S
Last seen 1 year ago
Member for 7 years, 4 months, 13 days
Difficulty Normal
Very elegant solution!
Just 1 question.
Why using
if '.'.startswith(segment)
instead of more readable
segment in ('.','')
?
More
Not bad, Kawalot!
This solution is very close to human thinking - so it's really clear.
But didn't you think about thinking more "computer way" can be more efficient but still clear?
That's what Python is really useful for!
Check out here: https://py.checkio.org/mission/pawn-brotherhood/publica
More
I like your native scientific approach.
I suppose this solution should be categorized as Creative.
More
+ Math is compact and simple
+ 6 vars for coordinates is a very good idea to make code much more readable!
- Result string formatting is very redundant.
I wish you optimize last half on formatting into single line of code - that will be great solution!
More
Great idea!
I'll try to reimplement it with native assembler style. :)
More
I think -5 is the best score for this solution:
1. Because it shows how to program Python with C/Java techniques. Not how to program Python right.
2. Moreover some Assembler style even used at lines 10-11 when decremented value is being put into new variable. What is the reason?
3. But even with Ass
More
This solution is perfectly "clear", "educational" and "compact" at the same time - I'd call it "Wise".
More
I suppose you would like using "for" statement instead of "while" - so you can get rid of "n+=1".
There're more options to make it better: rows 3 and 4 can be removed... etc.
Check out this compact and clear solution:
https://py.checkio.org/mission/pawn-brotherhood/publications/R2R/python-3/tiny/
More
Corrected bug in line 2. There were length limit <4 - it's obviously wrong. This version works fine for 3-digits chains too.
Many thanks for review to SiLiKhon.
More
I suppose it's most compact solution that's still readable and clear.
And it's speedy also - because of precalculation.
And it's stable against using mixed upper/lower letters in input dataset - since it's not restricted by preconditions.
Any suggestions how to make this solution better are really
More
Really cool!
I'm not sure changing iterator in the cycle is best practice.
But solution is really elegant: simple and clear.
More
I was very surprised to know Python interpret floats such a "binary" way most other programming languages hide from users and programmers.
Didn't got the idea - how can it be useful to work with floats such an inconvenient...
Thanks creators there's Decimal lib.
More
It's my third edition.
And it's best I can develop after reaching 11th level.
But still believe there's more elegant solution.
P.S. I don't think it's fair to plus myself. But everyone does and it's not prohibited still. And I want to become awesome!
More
Not very clear in fact.
Commenting code in English will make it more clear definitely.
More
Good solution!
But there's better one: https://py.checkio.org/mission/pawn-brotherhood/publications/R2R/python-3/tiny/
Check it out!
More
Very straightforward.
It's elegant to normalize input data to 4-digits and convert one-by-one.
Such approach can be useful in low-level programming, such as Assembler.
But with Python this is kind of "how not to" example.
More