24
amandel
8 25 40
3335/ 3445
Awesome Team Arnaldo Mandel
Last seen 23 hours ago
Member for 3 years, 2 months, 11 days
Difficulty Advanced
Best reviews / Newest reviews
Password_Verification.2-Elena_Korljukova 2
Bad use of boolean. If **B** is a boolean expression, then **True if B else False** has the same value as **B**. More
Explained - Kept simple-Selindian 1 1
The algorithm is straightforward, but it keeps too much state. No need for the direction list, you only need the last one; that would require a running counter, also. More
Heap-amandel 1
You are right, and I knew it. The test is there to avoid inserting 0's in the heap. Silly, anyway. More
max-Tinus_Trotyl 1
This is the best a solution can be! More
stack-Phil15 1
Your solution is identical to mine, both were published on the same day (mine is on speedy). Quite amazing, just the variable names are different (and the way of referring to the last element of a list). After checking some other solutions, I conclude we really nailed it. More
A long, long time ago...-veky 1
You are right, of course. I recently got an invite for the mission, and solved it with code not significantly different from yours. After passing the tests, I stepped back, and realized that I was making an unstated assumption, so I rewrote the code to an ugly one that starts by sorting the data. More
Casting out nines-amandel 1
I have improved it even more. I posted a new solution, named Logical It is a ridiculously simple one-liner: return num and ( num % 9 or 9 ) More
Casting out nines II-amandel 1
You're right. I realized it half an hour ago, and posted the new solution. More
First-mikaeldovbnia 1 1
Conceptually simple and natural. The test whether words contains a repetition should be moved to the top, thus avoiding unnecessary work. More
re, fullmatch, escape-kdim 1 1
Interesting use of regexp. There is an error, however: it doesn't detect the case where the last letter of text is repeated. >>> long_pressed('do','doo') False There is a simple fix, though: just add a '+' to the end of pattern. The test bed for this problem is very lame; it should have More
First-freeman_lex 1
Very pythonic, good use of iterators. More
while, slice-Sim0000 1
Clever (and well explained) handling of the special case. More
complex is better than complicated-veky 1 1
Beautiful use of complex numbers to keep track of rotation. More
Cached tiling counts-Phil15 1
Quite interesting: we both have recursive solutions, using @cache, and they look quite different, however both can do [18]*18, but not [20]*20. Math wins, anyway. Using Kasteleyn's Theorem [30]*30 is a cinch. More
Can it be done more simply than this?-adamspj 1
Your comment on my solution shows that you found out the answer to the title question is yes :-). Of course, the math is the same, the difference, as you pointed out, is the nonlogical use of python's logical operators. More
use heapq-kdim 1
I wonder, why list map instead of a simple comprehension? On the other hand, I liked the single line call to the heap operations. More
No need to convert-Selindian 1 1
You could simplify the boolean expression. More
Finally correct-amandel 1
BTW, increasing max_e and max_pi to 3, and even to 4 leads to some surprising results. For instance, try chekio(pi) with those values at least 3. More
1 liner lambda solution-swagg010164
This is a silly use of lambda. Writing one line with a def and a second line with a return ought to count as a one-liner for bragging rights, but is a cleaner code. More
Regular Expressions: now you have two problems-rossras 1
Very nice idea, however it fails on 'aabaab'; I understand that it should return the whole string in this case. I wonder how many solutions will fail this test. More
1
2 3 4