Nov. 23, 2017, 1:41 p.m. |
+ 1 |
for Comment
Amachua: Ok, my algorithm passes all test but failed if the alpha bat is at the entrance and that there is ot...
|
Nov. 23, 2017, 1:41 p.m. |
+ 1 |
for Comment
dorothyhs: I have not been active in a while. However, I think the page looks great! If we are going to make it...
|
Nov. 23, 2017, 1:41 p.m. |
+ 1 |
for Comment
bunnychai: I also like the new profile page. One minor suggestion is: many users have named their solutions as ...
|
Nov. 23, 2017, 1:41 p.m. |
+ 1 |
for Comment
oduvan: Thanks Vidal for your response. all two features will be returned soon.
|
Nov. 23, 2017, 1:41 p.m. |
+ 1 |
for Comment
Amachua: I like the new profile page but I think some things are missing: - we don't know our current experie...
|
Nov. 23, 2017, 1:41 p.m. |
+ 1 |
for Comment
VladdlaV13: I find mistake. There is no ' after VIII
|
Nov. 23, 2017, 1:41 p.m. |
+ 1 |
for Comment
MarishkaBagrova: I think going bitwise would be somewhat faster: Instead //2 just >>1 Instead %2 just &1
|
Nov. 23, 2017, 1:41 p.m. |
+ 1 |
for Comment
MarishkaBagrova: Hi bryukh, thanks for your reply. Here is something impotent that worth to be mentioned: timeit uses...
|
Nov. 23, 2017, 1:41 p.m. |
+ 1 |
for Comment
lesenv: yes, i know i should search repeating patterns, but when i print the "key"-numbers there are no repe...
|
Nov. 23, 2017, 1:41 p.m. |
+ 1 |
for Comment
contrebasse: if l % 2 == 1: For clarity, I would keep the ==1 here (or rather have !=0 actually).
|
Nov. 23, 2017, 1:41 p.m. |
+ 1 |
for Comment
Amachua: From what I see your problem is that you add spaces in two places: time = time + str (dheure (cpt, i...
|
Nov. 23, 2017, 1:41 p.m. |
+ 1 |
for Comment
oshava: Thanks for your answer, there is exact. I change the code, it's not good. I don't know how put code ...
|
Nov. 23, 2017, 1:41 p.m. |
+ 1 |
for Comment
floord: Thanks! :)
|
Nov. 23, 2017, 1:41 p.m. |
+ 1 |
for Comment
floord: Hi there! Could we keep the discussion in English? That way more people can help you find a solution...
|
Nov. 23, 2017, 1:41 p.m. |
+ 1 |
for Comment
Amachua: A solution was already found, that's why I've began to speak in french. For everyone, I translate wh...
|
Nov. 23, 2017, 1:41 p.m. |
+ 1 |
for Comment
lavalamp: return max(string.ascii_lowercase, key=lambda ch: text.lower().count(ch)) very clean
|
Nov. 23, 2017, 1:41 p.m. |
+ 1 |
for Comment
nickie: Nice solution, except you're computing one more grille than necessary. I agree with @veky that your ...
|
Nov. 23, 2017, 1:41 p.m. |
+ 1 |
for Comment
nickie: Not short but clean. Mine is very similar, using itertools.chain, whose implementation is just what ...
|
Nov. 23, 2017, 1:41 p.m. |
+ 1 |
for Comment
veky: Well, if it's important (I know it is to you:), b can be preprocessed so that verticals where nothin...
|
Nov. 23, 2017, 1:41 p.m. |
+ 1 |
for Comment
nickie: Oops... assert checkio([2,6,8]) == 0, 'triangle but not aligned!'
|
Nov. 23, 2017, 1:41 p.m. |
+ 1 |
for Comment
veky: If you haven't already, read "An optimization anecdote", by Guido (I referred to it in the comment a...
|
Nov. 23, 2017, 1:41 p.m. |
+ 1 |
for Comment
nickie: OK, this means that hashing when using dicts in Python (more precisely, all the defaultdict machiner...
|
Nov. 23, 2017, 1:41 p.m. |
+ 1 |
for Comment
nickie: This problem is much harder than it first looks. Not because it's hard to find a winning strategy fo...
|
Nov. 23, 2017, 1:41 p.m. |
+ 1 |
for Comment
andreusan: Thanks for your response. I solved the task already. However, according and comparing to the other a...
|
Nov. 23, 2017, 1:41 p.m. |
+ 1 |
for Comment
veky: Yes, removing instructions from inner loops makes sense. Another idea in this regard: move removal o...
|
Nov. 23, 2017, 1:41 p.m. |
+ 1 |
for Comment
veky: Tip, if you are curious: in difference to Haskell, you _can_ import and use something in Python in a...
|
Nov. 23, 2017, 1:41 p.m. |
+ 1 |
for Comment
nickie: And [this](http://www.checkio.org/mission/implementation/python-3/26680/#comment-outer-5909) was the...
|
Nov. 23, 2017, 1:41 p.m. |
+ 1 |
for Comment
veky: Morale: never say "you can't do something in Python". Especially when I'm around. :-D
|
Nov. 23, 2017, 1:41 p.m. |
+ 1 |
for Comment
nickie: You're right. Here's a one-liner in Python that works, more or less, in the same way as my Haskell o...
|
Nov. 23, 2017, 1:41 p.m. |
+ 1 |
for Comment
veky: Ok, so the "in spirit" Python equivalent is using collections.Counter, right? :-)
|
Nov. 23, 2017, 1:41 p.m. |
+ 1 |
for Comment
nickie: Each insertWith makes a new map, but it's not an entire copy. Maps are balanced trees: the path from...
|
Nov. 23, 2017, 1:41 p.m. |
+ 1 |
for Comment
veky: Correct me if I'm wrong, but isn't Haskell much more inefficient here? Every insertWith makes a new ...
|
Nov. 23, 2017, 1:41 p.m. |
+ 1 |
for Comment
nickie: As you and @Veky are fond of one-liners, here's a one-liner for this in **Haskell** (plus two extra ...
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
veky: Well, this is a nice example of "too much of a good thing". :-) You can consider it a parody of Llam...
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
veky: Recursion is not a good solution here (although it first pops to mind), since as you have seen, ther...
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
nickie: Yes, you're right, my mistake. I thought max was iterating over the text; it's iterating over the 26...
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
nickie: Short code but very inefficient. This is O(n^2) instead of O(n).
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
sat0yu: Oops! :-o I was careless. Thank you for pointing it out.
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
oduvan: "Harder, Better, Faster, Stronger" - Daft Punk "Harder, smaller, shorter" - Veky :)
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
veky: Though, both of us need to cope with "nonunderstanding" comments. Only, in your case, people would h...
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
veky: Understand that you're a cult. Whatever you write here, someone will say it's awesome. :-) (And what...
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
veky: Mine was BASIC (and it is equally serious as C, I can argue that as long as you want:-P). And alread...
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
veky: I now (probably) see what you mean. C has poisoned so many people's minds. We (at least _should_) in...
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
veky: The above is standard gotcha (in and == are same priority, chained), but here I must say I'm surpris...
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
qria: Ok found out why python does that. Apparently python considers == operator as a comparison, meaning ...
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
qria: Some explanation '@'<c evaluates to False if c is a number i&1 means i%2 ( I don't know why I wrote ...
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
veky: Do you _really_ write this on your mobile phone? And does it have Python installed? :-)
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
veky: The only problem is that this is not BFS. :-D (It uses priority queue instead of ordinary queue, and...
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
bunnychai: drawn a figure
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
bunnychai: Hi, the answer of Extra 1 is 19, but I've found a counter example: [[13, 1, 3], [13, 5, 2], [13, 5, ...
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
Miaou: If I may: def mp(t): could be replaced by '{:+.3g}'.format(t) which tells to format t with: * 'g' to...
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
veky: I finally gave up and made a universal A* mixin. Now I'll solve every task with it. :-D
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
guido: To solve the exact problem in the puzzle, a function would indeed be simpler (just write return inst...
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
guido: Heh. I have lots of power tools in my tool shed, but I still fix most things around the house with j...
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
veky: Actually no. That's what I'm telling you. max(a,f) is the greater of a and f. max(a,key=f) is not th...
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
artemrudenko: Magic is always around us
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
guido: I had a hard time deciding on the vote. On the plus side, this is a fairly complex algorithm and the...
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
Amachua: This error is also in the task description (first line). :)
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
cbrunet: Because generator expression inside list comprenhension at line 3 clearly doesn't belong to the "cle...
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
Fettn: The image seems to be labeled wrong if I am not mistaken. To me it seems that gold + tin is 1/2 is c...
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
Amachua: In the METALS list, I think you set ore instead of tin.
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
d4l: I think the logic is: if the latter player made a line too it should be a Dual:)
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
veky: I think you missed the word **empty** in my comment. I'm not against exceptions. But never write "ex...
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
veky: Here, I really think avoiding evaluating longexpression twice (if it is positive) should offset that...
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
veky: I see bryukh has started to assimilate my views, just as I started to assimilate his. :-D (My soluti...
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
veky: While you're shrinking... (longexpression if longexpression > 0 else 0) is shorter _and_ more readab...
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
pythonist: Why(!) everybody want to shrink the code to 1, 2 string? In my opinion it's not "pythonly". But what...
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
gamer133: The getNumber function already exists in Python : int(x, base)
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
qria: I think you misunderstood what a complete triangle means. a, b, c forms a complete triangle if and o...
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
profuel_39643665ff7744e3bff926: I assume that some double spaces are included in your result or in test expected result. Please do s...
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
nickie: I trust nothing about Python will puzzle you anymore, my friend... :-)
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
suwanditan: yes. thanks.
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
Vachenzo: Hey there. So here is a quick rundown of how publishing solutions works. The first three tasks do no...
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
Amachua: A two dimensional list can be seen as a graph. In this case you have, for each case, four possibles ...
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
PistolBear: Thanks so much! That makes a lot of sense already. I appreciate the help.
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
haveno: What is the reason behind not allowing solutions for this level? I solved it but my first solution s...
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
BoLuoMi6996: Now I know that, the first 3 problems don't accept solutions. So I can't see others' solutions. And ...
|
Nov. 23, 2017, 1:40 p.m. |
+ 1 |
for Comment
veky: yeah, the game is over for me. Maybe in Py4... :-D
|
Nov. 23, 2017, 1:39 p.m. |
+ 1 |
for Comment
veky: For all those who wondered how my "golf course" looks like in the zeroth iteration. I intentionally ...
|
Nov. 23, 2017, 1:39 p.m. |
+ 1 |
for Comment
veky: You intentionally set task with ambiguous (for you, for me and for Guido it is not ambiguous at all)...
|
Nov. 23, 2017, 1:39 p.m. |
+ 1 |
for Comment
veky: Yeah, democracy in programming. Last time humanity tried something like that, we got Perl6. :-P :-D
|
Nov. 23, 2017, 1:39 p.m. |
+ 1 |
for Comment
peter_parada: Thanks I finally did it with itertools. :) http://www.checkio.org/mission/implementation/python-3/26...
|
Nov. 23, 2017, 1:39 p.m. |
+ 1 |
for Comment
veky: Not exactly the same (loop is implied in comprehensions, and lists aren't dicts), but certainly rele...
|
Nov. 23, 2017, 1:39 p.m. |
+ 1 |
for Comment
PositronicLlama: I like the use of the 'min' function, but you could consider using the 'key' argument, which would e...
|
Nov. 23, 2017, 1:39 p.m. |
+ 1 |
for Comment
Kwilli271: I solved it by adding a for loop that copied the string to a new string excluding punctuation. It's ...
|
Nov. 23, 2017, 1:39 p.m. |
+ 1 |
for Comment
veky: 1. Readability. I know you find it funny considering what I write here, but even golfed to the core,...
|
Nov. 23, 2017, 1:39 p.m. |
+ 1 |
for Comment
veky: It's a py3 thing. But he uses / for truediv (not floordiv), so I thought it's obvious he writes in p...
|
Nov. 23, 2017, 1:39 p.m. |
+ 1 |
for Comment
veky: Ok, here goes. First, I really don't get why you take real nice Python ints, and convert them first ...
|
Nov. 23, 2017, 1:39 p.m. |
+ 1 |
for Comment
romazhuzha: Of course, we are and we always doing mistakes. This is almost main reason why I like this project. ...
|
Nov. 23, 2017, 1:39 p.m. |
+ 1 |
for Comment
romazhuzha: This won't work. But, this will: char_freq[c] += char_freq.get(c, 0) + 1 Maybe try-except is not a g...
|
Nov. 23, 2017, 1:39 p.m. |
+ 1 |
for Comment
tirab: Okay. I took the equation from the same wikipedia page you suggested but by mistake I took the one u...
|
Nov. 23, 2017, 1:39 p.m. |
+ 1 |
for Comment
veky: You don't have to make them so fast. ;-)
|
Nov. 23, 2017, 1:39 p.m. |
+ 1 |
for Comment
veky: Lots of "special" cases that aren't really special. See mine for general solution. ;-)
|
Nov. 23, 2017, 1:39 p.m. |
+ 1 |
for Comment
veky: I think you're a bit unrealistic. First, sequence alignment is a really well-studied problem. It wou...
|
Nov. 23, 2017, 1:39 p.m. |
+ 1 |
for Comment
nick.seigal: Thank you for your explanation and the link to your student's article! That is really a good explana...
|
Nov. 23, 2017, 1:39 p.m. |
+ 1 |
for Comment
htamas: That's a different issue: urllib and friends are not in the allowed modules list, see [Supported Mod...
|
Nov. 23, 2017, 1:39 p.m. |
+ 1 |
for Comment
PositronicLlama: That's totally fair, you should write code for CheckiO in the way you enjoy most. For my part, I lik...
|
Nov. 23, 2017, 1:39 p.m. |
+ 1 |
for Comment
PositronicLlama: Short and clever solution! But brevity is not the only goal - I would suggest trying to write the sh...
|
Nov. 23, 2017, 1:39 p.m. |
+ 1 |
for Comment
veky: 1. Is it guaranteed that solution exists? (What to return if it doesn't?) 2. What exactly is a goal?...
|
Nov. 23, 2017, 1:39 p.m. |
+ 1 |
for Comment
SlimeT: I guess I should have picked a different name: while(tau(i)<=n): sigmas.append(sigma(i)) i = i+1 the...
|