57
Awesome Team
Vedran Čačić
https://web.math.hr/~veky
Last seen 22 hours ago
Member for 11 years, 6 months, 6 days
Difficulty Advanced
We shall not cease from exploration, and the end of all our exploring will be to arrive where we started and know the place for the first time.
32?? LOL. You might have as well put 53 there. :-P
Python(3) int is not fixed size, this is not C.
More
Yes, this is in some way even simpler than mine. Nice work.
BTW, enumerate(accumulate(list of length 1... OMG. I know what you were thinking, but *sometimes* range(len( _is_ the right thing to iterate through (with slicing). :-D
More
LOL @ RPN. :-D
I think you'll find it even easier to generate infix expressions. See mine. :-)
More
pi is also in cmath (and has the same value:), no need to import it from math separately. :-)
More
You don't need outer parentheses in return. :-)
Also,
al, bl = map(int.bit_length, (a, b))
would probably be nicer (less duplication).
More
Disappointed! :-P
I expected at least you to see that all of these cases are just instances of a general formula. :-]
More
Awww, iter, finditer, and even _itertools.chain.from\_iterable_. Awww. :-D
Haven't you buried the idea of your solution a bit too deep? :-]
More
Hm. This doesn't _really_ work, it's just that the tester stops as soon as you reach the goal. It can be fixed (and your solution removed) later.
That being said, it's trivial to fix: just use another connective instead of +. Can you see what it is? :-)
More
Aargh. I think I taw a puddy tat... I mean, a semicolon. :-P
Please don't write C in Python. It's not just semicolons... comparisons, loops, the whole thing is so unpythonic it hurts. :-(
More
abs is already a function. Saying lambda x: abs(x) is a bit like saying str("Pointless"). :-)
(Smartsounding name is ["Eta reduction"](http://www.lambda-bound.com/book/lambdacalc/node21.html). But this only shows that many things have smartsounding names.:)
More
Not bad, but could be clearer.
Since you're not using a list as a list, but sorting it anyway at the end, a better structure might be a set (it might also give you the idea to use set.intersection, but let's not go too deep:). You could say you care about performance (and set.add _is_ a bit handi
More
Different operators can be chained too.
if a == b == c != '.': return a
More
Instead of .keys, try using .items:
for i, f in lettersFound.items():
Then you can write f instead of lettersFound[i] every time.
More
?? What _did_ you think float(median) does? Changes the type of a live value? :-O That's impossible even in C. ;-P
More