22
narimiran
7 24 41
2882/ 2945
Last seen 5 years ago
Member for 8 years, 4 months
Difficulty Normal
Would like to receive comments/critics of my published solutions.

Best reviews / Newest reviews
First-Kolahzary
Instead of manually flooring each result of a division with /, there's a much simpler way - using floor division with //. For example: data[len(data)//2] More
Bacteria Colonies-narimiran
`get_size` is trying to grow every existing cell into a healthy colony. If successful, it returns the size of colony, otherwise (unhealthy colony is grown) returns zero. More
I think, we can do this shorter-Ballistik
If you want shorter, lines 3 and 7 could be a bit shorter: sorted(args if len(args[:-1]) else args[0], ... For even shorter, take a look at [my solution](https://py.checkio.org/mission/min-max/publications/narimiran/python-3/minmax/) ;) More
First-keita.tmzw
You could have avoided duplicated code in two branches depending on the length of `args` with something like this: input_ls = args if len(args) > 1 else args[0] Now lines 3-13 and 29-39 are not needed. More
First-990099
Why didn't you use the same logic for `max` as you did for `min`, with the only difference that you pass `reversed=True` as another argument to the `sorted` function? More
Permutated generator-narimiran
Lines 7 and 8 - the first triangle from the input is always used as a starting point, only others are permuted. More
Recursive with pruning-ottosmo
Line 4 is easy to write manually when you have only three numbers, but what if you had more? Take a look at `itertools` module, it is very useful in many situations.... (here you could have used `itertools.permutations(range(3), 3)` ). More
Simple-MasterN 1
Most of the code is duplicated in both functions - you could have used a helper function, which would be called from each function (at least for lines 2-7 and 14-19, if not even more). More
First-ssk8 1
There is a `hypot` function in the `math` module, that could have been more elegant than your line 4. Line 13 would look like this: else: replace = hypot(*subtract(pre, cur)) < hypot(*subtract(pre, nex)) More
Jarvis March that includes collinear pts on hull-kkkkk 1
Line 29 - even without `key`, `data` will be sorted by the first element then by the second. More
Second-tarik.dsm 1
Line 4, more elegant way to see if string ends with some characters would be: subj.endswith('!!!') More
3 steps and regex-Eskimon
Instead of: `if not any(s for s in subj if s.islower())`, it would be easier just to check: if subj.isupper() Also, you can get rid of line 10 comment, if on line 11 you use a string method that is self-describing: if subj.endswith('!!!') More
First-Ardillo95
Nice idea to limit the range just to the half of the length of the data (line 6)! More
Magic**2-{d}-hrvoje
Some nice ideas here (hence upvotes), but not as speedy as I expected from a solution in this category (hence only two upvotes :)) More
First-davidezal
Lines 8-11 could/should be more pythonic if written as one line, by replacing `if` with `return`: return subj.isupper() or subj[-3:] == '!!!' or any(word in ... More
First-AlinaMalina
I took some liberty and refactored your solution: Lines 4 and 6 can be checked with one `if` statement. Line 9 is not needed if we use `subj.lower()` on line 10. `reps` is always 1, so it is not needed. Line 12: `join` accepts generator - no need to create a list (use `[` and `]`). It seems t More
First-k_dutch
Line 7: `total = sum(users.values())` Line 12: `while nodes:` Lines 18-20: `next` is a Python keyword, you should't use it as a name for your variables. More
First-mo0nz22 1
Line 9 - why joining a split subject when you can just use the original one with `if subj.isupper()`? ;) More
First-vladislav.bezugliy 1
Instead of importing `chain` and creating a set `all_nodes`, wouldn't it be easier just to change the line 15 to: disocnnected = users.keys() - connected More
First-s7even 1
Lines 7-10: more pythonic way of iterating is by directly iterating through elements, not indices: def customSet(word): tmp = [word[0]] for c in word[1:]: if c != tmp[-1]: tmp.append(c) return "".join(tmp) Line 14 is not needed. Lines 15 and More
1 2 3 4 5 6 7
8
9 10