22
Faibbus
6 22 32
2468/ 2945
→ Faibbus
Last seen 2 years ago
Member for 11 years, 4 months, 28 days
Difficulty Normal
Best reviews / Newest reviews
First-bravebug 1 1
Hello, naming things explicitely would help make your code clearer. Also line 5 could be simplified as `subj = (x.lower() for x in subj if x.isalpha())` More
Closure-veky 1 1
You are only a few comments away from perfection... But anyway, that's impressive. More
Slices-Sioul 1
Why not extract the upperHalf = (l+1)//2 instead of computing it twice ? More
achilles_and_the_tortoise-dannedved 1 1
The demonstration of the solution is a nice addition :) More
Bruteforce-ForcePush 1
Thank you, I laughed so hard :') More
First: regular expression-Grzegorz_Wieczerzak 1
Hello, since you are using `re.match`, you don't need to specify `^` in your regexes. You could also have removed the _(debug)_ print statements. But since you made an effort on the docstrings and variable names, here are some upvotes 😉 More
Achilles and the Tortoise-DmytroKaminskiy 1
Your formula is correct, but it could be simplified: ``` t2 × adv adv × (a1 - t2) + t2 × adv adv × a1 adv + ------------ = ---------------------------- = ---------- a1 - t2 a1 - t2 a1 - t2 ``` More
First-Lackerlax
Nice :) _(using `if args:` directly might imrpove it a tad)_ More
Straightforward-nickie 1
I find it not-so-great that all these lines of code are duplicated to just change a "<" to ">". On the other hand, I like the idea of caching the keys. More
I solved the equation, that's all.-Phil15
Hello, your formula is correct, but it could be further simplified: ``` t2 × adv adv × (a1 - t2) + t2 × adv adv × a1 adv + ------------ = ---------------------------- = ---------- a1 - t2 a1 - t2 a1 - t2 ``` More
straight forward-jiizzyy
Nice finite state machine (I got lazy and used `re`). More
not the best solution-five_east_west 1
Hello, - nice use of `isupper` 😀 - `pat` could be simplified by using `search` instead of `match` - `pat1` could be simplified as `'[^A-Za-z0-9 ]'` - line 8 could be abbriged to `if pat.match(sub)` - line 12 could be improved with `enumerate`: `for i, word in enumerate(c):` and then use `word` inst More
First-JaneDoe17
I don't think this solution qualifies as Speedy. You iterate: - once on `array` (let's say its size is `n`); - once on results (size `n//2`) to build `result1`; - once again on `results1` (for the `sum`, size `n//2`). So you could actually save `n` iterations (and some memory) with something al More
Clear one-line solution-bsquare
Your formula is correct, but it could be simplified: ``` t2 × adv adv × (a1 - t2) + t2 × adv adv × a1 adv + ------------ = ---------------------------- = ---------- a1 - t2 a1 - t2 a1 - t2 ``` More
Lamp dictionary-Wojciech__Lazuka 1
Why recreate `light_dict` in every call ? More
First-naexio 1
I bet you can find a more unusual solution ;) More
First-Moonra 1
I'm not sure about caching in python, but it might be best to sort your data only once. More
threeliner-macobo
Sometimes, 3 lines are better than one ;) I came up with almost the same solution ^^ but yours' even shorter. More
First-ssdev
Hmm, using my crystal ball, I'd say that your solution might only work in 1/4th of the times... More
First, one-liner-Faibbus
checkio = lambda data:(lambda f:(data[0][0] if len(data)==1 else sum([data[0][k]*(-1)**k*checkio(f(data,0,k)) for k in range(len(data))])))(lambda d,i,j:([[d[l][c] for c in range(len(d)) if c != j] for l in range(len(d)) if l != i])) Ok, I hadn't thought about that. Using that, the code would More
1
2