Oct. 30, 2021, 7:34 a.m. |
+ 1 |
for Comment
mombius: Oh, I did the same thing but used try-except to avoid the error when calling pop() in an empty stack...
|
Oct. 30, 2021, 7:20 a.m. |
+ 1 |
for Comment
jsg-inet: I like this solution: compact, and clean. You could put it in only one-line code. Just substitute "p...
|
Sept. 3, 2021, 10:49 a.m. |
+ 1 |
for Comment
dagger126: This can rewrite set(a) <= set(b)
|
Sept. 2, 2021, 9:13 a.m. |
+ 1 |
for Comment
Cjkjvfnby: No need to **set(second.split(","))**, intersects accept any iterable
|
Sept. 2, 2021, 8:49 a.m. |
+ 1 |
for Comment
jsg-inet: Very nice one-line code! Great!
|
Sept. 2, 2021, 8:47 a.m. |
+ 1 |
for Comment
jsg-inet: Very smart! Everyday learning something new!
|
Aug. 17, 2021, 9:56 p.m. |
+ 1 |
for Comment
Cjkjvfnby: Return **None, None** is good idea. **enumerate** has start argument. I don't sure that docstrings a...
|
Aug. 13, 2021, 6:39 p.m. |
+ 1 |
for Comment
shshlomy: very nice solution i will use: if x[int(i[0])] == x[int(i[1])] == x[int(i[2])]!="." instead
|
March 19, 2021, 10:20 p.m. |
+ 1 |
for Comment
mlahor: Classic straightforward solution. Good job!
|
Dec. 30, 2020, 4:11 a.m. |
+ 1 |
for Comment
ljy95135: I use a key=lambda x:abs(x) now I find I am quite wrong... Good answer!
|
Dec. 28, 2020, 2:37 p.m. |
+ 1 |
for Comment
megabitik: The second solution is creative and funny! Nice job!
|
Dec. 14, 2020, 5:16 a.m. |
+ 1 |
for Comment
Spiritusvini: The walrus operator is cool! But there is a bit shorter: return [[items.pop(0) for i in range((len(i...
|
Dec. 14, 2020, 3:17 a.m. |
+ 1 |
for Comment
shiracamus: A little shorter: checkio=lambda x:"www" in "".join('dw'[w.isalpha()] for w in x.split())
|
Dec. 10, 2020, 1:19 a.m. |
+ 1 |
for Comment
dfridman: I'm just learning and I usually come to the solutions to see how more experienced people do it. I of...
|
Nov. 17, 2020, 10:36 a.m. |
+ 1 |
for Comment
tokareva.anastasiya.tch: Nice job making it clear and effective
|
Nov. 16, 2020, 1:04 p.m. |
+ 1 |
for Comment
martin.pilka: Does not work for `symbol` param longer than 1 char, e.g.: `assert second_index("ab ab", "ab") == 3,...
|
Nov. 16, 2020, 1:03 p.m. |
+ 1 |
for Comment
LuisV_4ed4dd38f49c4f67b0a568dd: Yes, I much prefer this to the alternative (using index() and catching the exception if it throws).
|
Nov. 16, 2020, 12:36 p.m. |
+ 1 |
for Comment
Parzifal: word.lower() is not necessary, due to input requirements
|
Nov. 16, 2020, 12:32 p.m. |
+ 1 |
for Comment
ProgrammerBruce: Prefer casefold() instead of lower(). Also, casefold the keys (in words) for best matching.
|
Nov. 15, 2020, 9:23 a.m. |
+ 1 |
for Comment
veky: You're reinventing [the wheel](https://docs.python.org/3.9/library/heapq.html#heapq.nlargest).
|
Nov. 15, 2020, 6:11 a.m. |
+ 1 |
for Comment
piter239: Exactly! I am proud I found the same solution by myself))
|
Nov. 12, 2020, 1:58 p.m. |
+ 1 |
for Comment
Luftkrieger: There is no need in print(text) and you can just use "replace" without "find". Good luck!
|
Nov. 12, 2020, 7:20 a.m. |
+ 1 |
for Comment
Cjkjvfnby: Set -1 because **len(array) == 0** PEP8: For sequences, (strings, lists, tuples), use the fact that ...
|
Nov. 11, 2020, 11:41 a.m. |
+ 1 |
for Comment
koladen: Will work without value > one, return abs(value - one), value
|