21
hanpari
7 25 46
2435/ 2695
Last seen 11 months ago
Member for 10 years, 6 months, 16 days
Difficulty Normal
Author of Sovereign https://www.royalroad.com/fiction/26615/sovereign My blog https://pavelmorava.com/

Best reviews / Newest reviews
Floyd–Warshall rev2-natsuki
I believe you actually dont need to call: def all_cells(): return ((x, y) for y in range(8) for x in range(8)) In fact, this should be enough: all_cells = [(x, y) for y in range(8) for x in range(8)] More
First-MackM
Too many unnecessary moves :) For example this is enough. return "".join(Translation) In python casing is different. For variable is used lowercase and for constant UPPERCASE (e.g.: index, VOWELS) More
Edge Detect-SamSchurter
You could safe few lines using this code starting line 4: for col, row in pawns: ... More
First-bukebuer 1
I see no point in line 4 :) It seems to me like desperate try to save one line :) Surely, it is a little bit faster but less clearer More
First-jcg
This should be in category puzzle :) More
First Fractions-tobytobytoby
Except for line 10 which is rather wrong (output should be tuple not list) I think this solution is pretty clear. BTW: As I saw in previous solutions line 4 can be improved like this. I didnt know it myself. remaining = 1 More
First-SkielCast
You dont need to convert set to list More
First-rbrian
In this case is lambda expression redundant. key = abs abs is function itself More
First-rbrian
In this cases I would not use new name variable but first = set(first.split(',')) Seems to me clearer. BY the way, the line 4 is redundant. You dont need to convert answer to list :) Hope it helps. It is nice, though. More
First-chaz.ruhl 1
if x == 1 and y == 1: return True else: return False could be convert to: return True if x and y else False Hope it helps. More
First-artemrudenko 2
You can check mine if you feel like this. I couldnt say my solution is better because your using bit operator is wiser but my code is similar with little different approach. You may find it interesting :) More
First-CatHeist
Just one hint. Try this one: sample = "This is sample Text Sample" result = {char:sample.count(char) for char in sample.lower() if char.isalpha()} or check Counter from collections :) Subject: [CheckiO] Your random review: The Most Wanted More
Solutions for "The greatest common divisor"-linxiaohui 1
What about something like this: def gcd(a,b): a,b = sorted((a,b), reverse = True) return gcd(b, a%b) if a%b else b I hope I made no mistake. No guarantee without running the code :) And of course you should try :) import gcd from fractions Subject: [CheckiO] Your rand More
First-adrian.wawrzak
Nicely named variables, just few quick hints to shorten your code: you can use: for i, current in enumerate(phrase): and you can write: indexesToSkip += [i+1, i+2] Hope it helps. Subject: [CheckiO] Your random review: Bird Language:Uncategorized:52447 More
First-svenhofmann1985
Nice, but of course you might use: return (max(args) - min(args)) if args else 0 Subject: [CheckiO] Your random review: The Most Numbers:Clear:52939 More
First-Tsutomu-KKE
Well done! Subject: [CheckiO] Your random review: Simple hashlib:Uncategorized:53547 More
Double-ended queue-bryanandrade
It is a small thing but what about to revert your code like this to make your code clearer? for move in moves: xi, yi = x + move[0], y + move[1] if (xi, yi) == b: return len(path) if all(0 < xi < 9, 0 < yi More
First-RandyWaterhouse
Hi, you solutions is really really wet :) Consider this JUMPING = { (3,8) : (-2,1), (2,7): (-1,2), .... } def jump_targets(field): ... x,y = JUMPING[col, row] targets.append(back_translation[x]+str(y)) r More
First-traxy
What is this special case? if numbers == [-10,-1,-1,-10]: return -2 Subject: [CheckiO] Your random review: Stair steps:Uncategorized:54466 More
First-reguy3 1
Instead your: for i in range(len(matrix)): for j in range(len(matrix)): ... you can use product from itertools from itertools import product for i,j in product(range(len(matrix))): ... Hope it helps Subject: [CheckiO] Your random review: Weak Point More
1
2
3 4