18
Riddick
6 19 36
1889/ 1945
Last seen 9 months ago
Member for 9 years, 6 months, 20 days
Difficulty Normal
Best reviews / Newest reviews
First-hkgok1
You can use all logic inside try/except. try: st = text.index(begin) + len(begin) except: st = 0 And the same for end case. More
First-spiros738
You can merge in one line of code. More
reverse sort with lambda to return list comprehension with limit-ezebw2 1
Will be more readable if you use slices for this solution. More
First-tvylormvde 1
Not bad, you can do this solution in one line of code. More
First-snowd2020
Please merge 2 lines of code in one and it will be nice! More
Sort 'name', then 'price'-armandolios
Why do you use `list.sort(data, key = lambda k: k["name"])` ? You can use only this one `list.sort(data, key = lambda k: k["price"], reverse = True)`. list.sort - not obviously will be nice avoid this construction. More
one_line-wii_caiji
Maybe the shortest solution that I saw. More
First-ElisaZeneli 1
Please use lambda function instead nested function. Thanks! Nice solution! More
First-novelworm 1
You may not use 0 in data[0:limit] It will be like data[:limit] More
Use an end range that is half the desired sum-kkkkk 1
Interesting solution, But I think with `while` will be more clear More
First-Arahabakan
What do you think about recursion? More
ABC <= TXT-Ilis 1
nice solution. It will be nice to use `string.ascii_uppercase` instead `ABCD...`. It will be more robust code. More
All-Sioul
Interesting approach, I recommend to look on builtin library `string` with property `ascii_lowercase` More
First-ki1ler
You may change a some part of code for more readable. For example, you may check to %15 firstly and return str(number) in the else block code: if number % 15 == 0: return 'Fizz Buzz' ... else: return str(number) More
First-margot
You may write in one line: return True if all(elem == list[0] for elem in list) else False More
O(N) - without .count-nakanohito_piyo 1 1
I think this solution should be in uncategorized solutions. Firstly, you may use from collections import defaultdict that create dict with all data count And secondly, you approach looks like O(n*log(n)) but in general in this category for this issue - O(n) More
max-r.nov.07.b.b 1
Looks good for clear solution, but non-effective around big-O. Looks like O(n**2) for this solution. More
My first answer-yuta0613
Looks good, maybe will be better change 5 strings of code in one, for example: return array[n]**n if len(array) >= (n+1) else -1 And a little refactoring you can check len(array) without more or equal but only more, e.g.: return array[n]**n if len(array) > n else -1 More
All the Same-Ferril 1
Good solution, but I think you may improve this. Firstly, you check list is non-empty if empty you will return True. Secondly, you check if non-empty length list equal 1. Probably, will be good something like this: return len(set(elements)) < 2 More
Solutions for "All the Same"-An.S.
For more readable you might write something like this: flag = True if elements: some your code return flag More
1
2