23
brubru777
8 23 36
3032/ 3195
Last seen 2 years ago
Member for 8 years, 8 months, 13 days
Difficulty Normal
Best reviews / Newest reviews
Second-dandd31 2
`is_alive` should be a "property". To keep it simple, a property is a function which can be invoked like an attribute. Here's the syntax: @property def is_alive(self): # return something More
recursive touch/infect-jmegner 1 1
Very clean solution. Just a little question. Wouldn't `max` be simpler than `sorted(...)[-1]`? More
First-kurosawa4434 1 1
Clever solution. To get the metals, a simpler solution would be metal1, metal2 = k.split('-') You could also declare `METALS` as a set at the beginning for efficiency. More
Counter-Sim0000 1
Most elegant and efficient solution I've seen. More
First-Sorrop 1 1
Hi, Here's a little Python trick. You can replace your last if by return min_quantities[-1] or None If `min_quantities[-1]` is not 0 (i.e. is `True`), it will be returned. If it is 0 (i.e. is `False`), `None` will be returned. More
filter-veky 1 1
I was surprised to see so many negative comments for your solution. It is a similar to mine but a bit more compact and I dare say "elegant". Whether it respects the format you're supposed to use for answering or not isn't really relevant. The purpose of being able to look at other people's code is t More
First-fokusd 1
Simple and elegant. I love it. More
First-Sim0000 1
Nice short solution but you could greatly improve its readability with meaningful variable names. More
First-stum74 1
Instead of `n > len(array) - 1`, I find `n >= len(array)` more natural. But that's just a detail. More
First-gsbullmer 1
Sure. With your algorithm, you check every value between the min and the max. If max - min = 1,000,000,000, you're going to check 1,000,000,000 numbers even if the array has only two elements. If you sort the array first, you only need to check pairs of consecutive numbers in the array. If their d More
First-h0d
Hi, I'm sorry but this is not fast at all. "t in reversed_text" is O(n^2). That makes your algorithm O(n^4). More
The Most Frequent Weekdays-c135260
Hi, There are solutions without loops. Hint: How many days are there in a year? (modulo 7) More
Compare Functions-narimiran 1
Hi, Your solution helped me to improve mine. Thanks. More
Straightforward-jymaze
Hi, For simplicity, you could move the `ret.append(letter)` before (or after) the if. More
First-mateusz.miekus
Hi, This brute-force code works but it's not fast. It's O(n^3). More
First-Eugene23
Hi, Since you find the digits from highest to lowest, you can just reverse the list instead of sorting it. It's a tiny bit faster. More
First-saklar13
Hi, It's certainly short but unreadable. You should have kept the original variable names. More
First-jcg
Hi, Cleanest solution I've seen so far. More
First-grazik
Hi, There's a formula to find the exact time. It requires very simple algebra. More
1
2 3