39
freeman_lex
13 39 53
9242/ 9695
Awesome Team Олександр Зозуля
Last seen 6 hours ago
Member for 9 years, 11 months, 17 days
Difficulty Easy
Best reviews / Newest reviews
float if dot else int-veky 2 1
`(float if dot else int)()` cool! More
easy-Marco_Monti 1 1
do not use keywords as variable names More
1-liner solution (sum + zip)-swagg010164 1
Notice a few moments to improve the solution: 1) no need to use `list()` on `sorted()` since `sorted()` returns `list` object; 2) since `bool` value may be interpreted as `int`, `k != v` is enough to get 1 or 0; 3) `sum()` can take list comprehension as argument, so no need in `[]`. More
First-penedesimio 1
Your solution is wrong, because it does not allow case "Characters in String B are allowed to correspond to multiple character values in String A." For the test isometric_strings('abba', 'cccc') it returns False, though True is correct. More
chain-kurosawa4434 1 1
I am totally sure you know, that "if group" is enough to check emptiness) More
Memoization and Recursion-kurosawa4434 1
Haven't seen your solution before solving, just think quite the same way) More
First-freeman_lex
Variables naming and comments by ChatGPT. More
Slow and simple-suic 1
Olmost the same as mine) But dont you think its better to make res and dvs arrays global and with each call do operations inside loop not with all atts (again and again with the same information) but only once with last!) More
First-plubius3 1
Hi) 1) No need to write "0" in range; 2) In such cases use xrange. More
DP top down-juestr 1
Notice, that you don't actually need `elif` when every branch ends with `return`. It may be organized just as a bunch of `if`'s. More
First "Backward Each Word" (two ways)-olgag
No need to use join here. newtext.append("".join(word[::-1])) More
First-freeman_lex
I've used ChatGPT to generate comments and exlanation for this solution. The "remove_brackets" function is the entry point of the solution. It initializes a global variable "result" to store valid bracket combinations and then calls the "remove_spare" function to start the removal of unnecessary br More
First-9gress0r
Will not work if string starts with ' '. To follow your strategy you use lstrip() before loop. Besides, you don't need variable count, because 'i' is doing the same job, range doesn't need '0', as well as text slicing in return. Hm...you don't need break as well, you may return you result write ther More
Sorted dict-bostonz1
You may replase lst = [] for num in values: lst.append(abs(one-num)) with list comprehension lst = [abs(one-num) for num in values] # or lst = list(...the same) In a lot of cases it's even better to use [generator expressions](https://peps.python.org/pep-0289/) lst = (ab More
Simple | lstrip instead of regex-Wartem
The idea is cool, but I guess the solution needs improvement. You don't catch a case, when `typed` ends _before_ `text`. Check correct `assert long_pressed("abc", "aabb") == False` The cure could be something like: `...` `while(text and typed):` `...` `return typed == text == ""` More
Quick & no list-freeman_lex
def longest_palindromic(a): for x in xrange(len(a)-1, -1, -1): for y in xrange(len(a)-x): s = a[y:1+x+y] if s == s[::-1]: return s More
abs-Vooply
Your solution returns True for this example, which is wrong: goes_after('world', 'a', 'r') More
Fast-iurii.novikow
Your solution doesn't woro properly in such example as "abbazb", "a", "z" More
First-Crispy
Your solution returns True for this example, which is wrong: goes_after('abbaz', 'a', 'z') More
Basic, with no unnecessary checks-mubli
Your code could be cleaner: def checkio(number): if not number % 3: if not number % 5: return "Fizz Buzz" return "Fizz" if not number % 5: return "Buzz" return str(number) More
1
2 3