Oct. 2, 2014, 2:17 a.m. |
+ 1 |
for Comment
MooMoo: Maybe you forgot some brackets, and it should be something like this? lambda kv: [kv[1], kv[0]] Othe...
|
Oct. 1, 2014, 10:19 a.m. |
+ 1 |
for Comment
reviewboy: Ooh, that's nice. this is much more readable than mine. return min([(-1 * ltext.count(c), c) for c i...
|
Oct. 1, 2014, 8:55 a.m. |
+ 1 |
for Comment
profuel_39643665ff7744e3bff926: you must use LAST element to multiply, not the MAX value of the ones in array. Please try this: chec...
|
Oct. 1, 2014, 8:54 a.m. |
+ 1 |
for Comment
nikola.pepic: Example: N = 3. You need to find a member of the array that has index of 3. Let's call that member X...
|
Sept. 29, 2014, 9:01 p.m. |
+ 1 |
for Comment
Martin.N.Menendez: In my university (UBA-University of Buenos Aires) there is a big discussion about replace Pascal for...
|
Sept. 29, 2014, 8:27 p.m. |
+ 1 |
for Comment
artemrudenko: Hi Thomas, You can change you signature from: def checkio(acc, data): To: def checkio(data, acc=''):...
|
Sept. 29, 2014, 1:02 a.m. |
+ 1 |
for Comment
Sim0000: Because your *visited* is global variable.
|
Sept. 28, 2014, 9:08 p.m. |
+ 1 |
for Comment
ablikexe: It should be **num < len(array)** - as you wrote in 7th line, the last element has index **len(array...
|
Sept. 27, 2014, 9:14 p.m. |
+ 1 |
for Comment
Cjkjvfnby: It is shame for professional programmer to ask such questions. If you can solve this task in your la...
|
Sept. 27, 2014, 9:14 p.m. |
+ 1 |
for Comment
Cjkjvfnby: http://blog.codinghorror.com/why-cant-programmers-program/
|
Sept. 27, 2014, 5:54 a.m. |
+ 1 |
for Comment
melsener: i didn't see that condition first. thank you.
|
Sept. 27, 2014, 5:48 a.m. |
+ 1 |
for Comment
Renelvon: Perhaps I could get rid of the 'subtract' and just use return [x for x in data if count[x] > 1] This...
|
Sept. 27, 2014, 5:44 a.m. |
+ 1 |
for Comment
veky: What? :-) It's a list comprehension. Just read it, you'll probably understand. :-)
|
Sept. 27, 2014, 5:44 a.m. |
+ 1 |
for Comment
veky: I've noticed a tendency: people come and like my solution, and then dislike comments like these. Fas...
|
Sept. 27, 2014, 5:41 a.m. |
+ 1 |
for Comment
DillonKo: Hi I would love to help if you have any questions I will be more than happy to help you understand h...
|
Sept. 26, 2014, 5:31 a.m. |
+ 1 |
for Comment
veky: Guido used to tell a story, about a man doing taxes in ABC (predecessor to Python), when his program...
|
Sept. 25, 2014, 9:45 p.m. |
+ 1 |
for Comment
RufusVS: +1
|
Sept. 25, 2014, 9:45 p.m. |
+ 1 |
for Comment
Lom: Yes.
|
Sept. 25, 2014, 4:02 a.m. |
+ 1 |
for Comment
flerptyderp: Oh God, never mind. I overlooked something.
|
Sept. 25, 2014, 1:18 a.m. |
+ 1 |
for Comment
ArchTauruS: I have done it too. Have a look at my code, hehe.
|
Sept. 24, 2014, 9:17 p.m. |
+ 1 |
for Comment
Blastus: CogbkrO jutjeocuo ueteglaubrii tnyhugklnbvw ellebiiot ki lywvbonkho. K = agneibyrctklhwsvouj, oyneru...
|
Sept. 24, 2014, 1:10 a.m. |
+ 1 |
for Comment
ablikexe: "Task is closed"
|
Sept. 24, 2014, 1:10 a.m. |
+ 1 |
for Comment
gyahun_dash: I found a test that doesn't satisfy all(len(row) == len(state) for row in state).
|
Sept. 24, 2014, 1:10 a.m. |
+ 1 |
for Comment
Sim0000: Nice mission! I have fun it.
|
Sept. 23, 2014, 9:01 p.m. |
+ 1 |
for Comment
ablikexe: Function **sorted** returns a list - you should remove spaces before sorting (with **replace**) [the...
|
Sept. 22, 2014, 8:44 p.m. |
+ 1 |
for Comment
ablikexe: Nice solution! But there is maximum recursion depth limit - http://stackoverflow.com/questions/33230...
|
Sept. 22, 2014, 8:30 p.m. |
+ 1 |
for Comment
ablikexe: You should pass something iterable to functions *max* and *min* - you can write **max(args)-min(args...
|
Sept. 19, 2014, 8:58 p.m. |
+ 1 |
for Comment
ablikexe: If you want to calculate float, you should use **/** instead of **//** (in 15th and 17th line) ;)
|
Sept. 19, 2014, 8:38 p.m. |
+ 1 |
for Comment
veky: This is a really nice twist. Not unmanageable, but be prepared for many petitions for somehow distin...
|
Sept. 17, 2014, 9:09 p.m. |
+ 1 |
for Comment
coells: First, let's look at some recommendations: enumerating string char by char is quite simple in python...
|
Sept. 17, 2014, 9:08 p.m. |
+ 1 |
for Comment
hanpari: Try to learn about function enumerate. One of my favorites :)
|
Sept. 17, 2014, 9:08 p.m. |
+ 1 |
for Comment
ablikexe: Hi! You should use simply *e* instead of *expression[e]* ("for" loop takes elements of *expression* ...
|
Sept. 17, 2014, 9:08 p.m. |
+ 1 |
for Comment
ablikexe: Hi, *array.index(i)* returns the index of the **first occurence** of *i* in the array. That means th...
|
Sept. 17, 2014, 9:08 p.m. |
+ 1 |
for Comment
bunnychai: your approach only works on unique set of values, for the failed case, 84 is duplicated, index() onl...
|
Sept. 17, 2014, 9:08 p.m. |
+ 1 |
for Comment
veky: This concrete example is a bit controversial, since "".join might benefit greatly from knowing in ad...
|
Sept. 17, 2014, 9:08 p.m. |
+ 1 |
for Comment
vbereznyuk: Вам дан некоторый текст потенциально содержащий обычные слова. Вы должны рассчитать, сколько обычных...
|
Sept. 16, 2014, 10:55 p.m. |
+ 1 |
for Comment
ablikexe: I am getting result "durin" instead of "these" in third test... Well, I'll try some other ways. In t...
|
Sept. 16, 2014, 9:52 p.m. |
+ 1 |
for Comment
ciel: It's calculation order is O(nlogn). Usual solution takes O(n^2).
|
Sept. 16, 2014, 9:52 p.m. |
+ 1 |
for Comment
nickie: Well done. I have a slightly slower version (more Pythonic in the merging phase) with comments and l...
|
Sept. 16, 2014, 8:33 p.m. |
+ 1 |
for Comment
veky: Bryukh - an engine for turning coffee into preconditions. :-D > You are fast :-) No, my fourliner wa...
|
Sept. 16, 2014, 8:31 p.m. |
+ 1 |
for Comment
ablikexe: Yeah, you write in C/C++ style :) Just in case you don't know: you don't need parentheses after if. ...
|
Sept. 16, 2014, 8:31 p.m. |
+ 1 |
for Comment
ablikexe: Items in dictionary (line 17, "for let, num in mp.items():") are in "random" order, and you want the...
|
Sept. 16, 2014, 8:30 p.m. |
+ 1 |
for Comment
profuel_39643665ff7744e3bff926: Imagine no items in array, last == -1, of course it's out of any list bounds
|
Sept. 16, 2014, 8:28 p.m. |
+ 1 |
for Comment
veky: [You've missed len() at the right side.] Ah, good. Then I have a fourliner. :-D
|
Sept. 16, 2014, 8:19 p.m. |
+ 1 |
for Comment
veky: Hm... do we know that new encrypted message will always be shorter than the old one? Or at least tha...
|
Sept. 14, 2014, 11:58 p.m. |
+ 1 |
for Comment
bbmin7b5: Ok I get different a different order the second time around. I'll tear down my code and start over. ...
|
Sept. 14, 2014, 1:56 a.m. |
+ 1 |
for Comment
Sim0000: The two example of initial editor code have errors. Followings are correct. encode("My name is Alex!...
|
Sept. 12, 2014, 9:05 p.m. |
+ 1 |
for Comment
kidnohr: thank you!! I can solve this task!!
|
Sept. 10, 2014, 9:59 p.m. |
+ 1 |
for Comment
gyahun_dash: In Precondition, you mean: 4 ≤ len(str(key)) int(len(str(key)) * 1.5) ≤ len(message) re.match("\w+$"...
|
Sept. 10, 2014, 8:02 p.m. |
+ 1 |
for Comment
Sim0000: The task explanation says "Text letter case does not matter". And your code ignore this.
|
Sept. 10, 2014, 9:42 a.m. |
+ 1 |
for Comment
profuel_39643665ff7744e3bff926: You have additional spaces at the beginning. I suggest using list to combine numbers - nlist - and t...
|
Sept. 9, 2014, 10:44 p.m. |
+ 1 |
for Comment
veky: > not how I define the spirit of this game. And that's worth -3 for you? Ok, whatever. But I must la...
|
Sept. 9, 2014, 9:20 p.m. |
+ 1 |
for Comment
Sim0000: In line 25, you use list[i]. Maybe, data[i] is correct.
|
Sept. 9, 2014, 9:20 p.m. |
+ 1 |
for Comment
pohmelie: Square brackets at line 25, I think. fin.append(list[i])
|
Sept. 9, 2014, 7:50 p.m. |
+ 1 |
for Comment
profuel_39643665ff7744e3bff926: I feel, it should look like this, not sure it will work. def checkio(data): re.match("[a-zA-Z0-9]+",...
|
Sept. 9, 2014, 7:49 p.m. |
+ 1 |
for Comment
salazar.aldrin: I execute the code as is in the OP, there are no uppercased letters. Always returns -1 it should ret...
|
Sept. 9, 2014, 7:49 p.m. |
+ 1 |
for Comment
taras-sereda: Try to execute your code line by line. Last statement should return 0 as position of pal[3] in text ...
|
Sept. 9, 2014, 7:49 p.m. |
+ 1 |
for Comment
profuel_39643665ff7744e3bff926: It simply works. I think, initial version of your **text** contains uppercased letters. Please try t...
|
Sept. 9, 2014, 7:45 p.m. |
+ 1 |
for Comment
profuel_39643665ff7744e3bff926: Last test: IndexError: list index out of range, index_power, 8 index_power((96,92,94), 3) which mean...
|
Sept. 9, 2014, 7:37 p.m. |
+ 1 |
for Comment
ablikexe: Hi! In 3rd line, it should be simply "for c in words:" (now it does something you probably don't wan...
|
Sept. 9, 2014, 3:41 a.m. |
+ 1 |
for Comment
ablikexe: I can't help much, because I was familiar with C++, and most of the time I was just guessing what wo...
|
Sept. 9, 2014, 3:40 a.m. |
+ 1 |
for Comment
pohmelie: I read Lutz book at first (only quarter thow), than went to dive into python (again, nearly half). A...
|
Sept. 9, 2014, 3:40 a.m. |
+ 1 |
for Comment
EmilyGlass: I didn't know about the nextdayvideo YT channel, I will check it out. Thanks!
|
Sept. 9, 2014, 3:37 a.m. |
+ 1 |
for Comment
oduvan: Looks like a new island is coming :)
|
Sept. 8, 2014, 4:06 a.m. |
+ 1 |
for Comment
Amachua: Of course, it could increase the gap between two solutions but it's part of the game (learning thank...
|
Sept. 7, 2014, 9:36 p.m. |
+ 1 |
for Comment
profuel_39643665ff7744e3bff926: It works for me once. So the problem is STATIC res in params. Replace on res=None and init with [] a...
|
Sept. 4, 2014, 10:17 p.m. |
+ 1 |
for Comment
ablikexe: "The radiation is emitted from the largest **group** of identical spare parts **(where each part is ...
|
Sept. 4, 2014, 8:12 p.m. |
+ 1 |
for Comment
veky: Croatian (and probably Russian too:) language has a wonderful reply to that: nema na čemu. It is usu...
|
Aug. 30, 2014, 5:19 a.m. |
+ 1 |
for Comment
hanpari: please, dont leave us :)
|
Aug. 29, 2014, 9:33 a.m. |
+ 1 |
for Comment
veky: > that does not compute the value... "_That_" is a bit misleading. Do you at least agree that I had ...
|
Aug. 29, 2014, 8:54 a.m. |
+ 1 |
for Comment
Kerulen: "A plot hole is a single white-space surrounded by letters, digits or punctuation symbols - up, down...
|
Aug. 26, 2014, 6:12 a.m. |
+ 1 |
for Comment
pohmelie: \*thumbs up\*
|
Aug. 25, 2014, 9:50 p.m. |
+ 1 |
for Comment
veky: In first iteration it was if x == a: x = b elif x == b: x = a But hey, 1 line is better than 2 lines...
|
Aug. 20, 2014, 12:46 a.m. |
+ 1 |
for Comment
debdeppeler: As I'm new to Python, the Simple list comprehension is very new. Thanks for the simple presentation ...
|
Aug. 19, 2014, 10:25 p.m. |
+ 1 |
for Comment
blabaster: Wrong. The rule is: "If you have two or more letters with the same frequency, then return the letter...
|
Aug. 15, 2014, 12:50 a.m. |
+ 1 |
for Comment
ablikexe: It makes sense, but there are two problems with your solution. First: it is too slow. Why? Because t...
|
Aug. 14, 2014, 11:19 p.m. |
+ 1 |
for Comment
Sim0000: Thanks for your comment. This result is the application of BFS. Starting from the goal, we produce a...
|
Aug. 14, 2014, 11:18 p.m. |
+ 1 |
for Comment
ale1ster: Zip objects are generators. Generators are consumed by looping and are not subscriptable (which mean...
|
Aug. 13, 2014, 11:26 p.m. |
+ 1 |
for Comment
Cjkjvfnby: Using two sets you can **common = first\_set & second\_set** but I prefer to use **intersection**.
|
Aug. 12, 2014, 9:40 a.m. |
+ 1 |
for Comment
spoty: The result must be represented as a string of words separated by commas in alphabetic order. Sort li...
|
Aug. 12, 2014, 9:40 a.m. |
+ 1 |
for Comment
spoty: You are not an idiot ;) It just happens. Our brain is machine for information supplementation, so ne...
|
Aug. 11, 2014, 9:15 p.m. |
+ 1 |
for Comment
ale1ster: I don't know what is wrong with your answer, but you can create a constructive proof that the result...
|
Aug. 10, 2014, 7:58 p.m. |
+ 1 |
for Comment
ale1ster: What do you mean it doesn't work? Does the interpreter throw an error or it just returns the wrong v...
|
Aug. 10, 2014, 7:57 p.m. |
+ 1 |
for Comment
ale1ster: Ok, taking a stab at the _implicit_ (!) question, there is a problem with your solution... You are c...
|
Aug. 10, 2014, 7:50 a.m. |
+ 1 |
for Comment
ale1ster: Thanks, I think it's much clearer now :)
|
Aug. 8, 2014, 11:47 p.m. |
+ 1 |
for Comment
pohmelie: > for number in checkio It's really error. "checkio" is your function, you should not iterate over i...
|
Aug. 8, 2014, 11:46 p.m. |
+ 1 |
for Comment
ablikexe: Hi, the first thing is that checkio function is called multiple times with different tests, so if yo...
|
Aug. 5, 2014, 12:25 a.m. |
+ 1 |
for Comment
pohmelie: * Python-only oriented challenge * Good ecosystem (editor, forum, reviews, votes, own tasks) * Golf ...
|
July 31, 2014, 9:42 p.m. |
+ 1 |
for Comment
ale1ster: You should probably ask a question with the code fragment, but this code has 2 major flaws. First of...
|
July 30, 2014, 10:03 p.m. |
+ 1 |
for Comment
Sim0000: I try your code. In the case of checkio("1st 2a ab3er root rate"), after your first loop (for c in u...
|
July 28, 2014, 10:57 p.m. |
+ 1 |
for Comment
johnhaines: Hint: Look at where you are setting j. What is happening to its value each time you look at the next...
|
July 26, 2014, 11:22 p.m. |
+ 1 |
for Comment
blabaster: #update global varialbes if curEdge != None: edgesList.remove(curEdge) ... ... #go over all edges fo...
|
July 26, 2014, 11:21 p.m. |
+ 1 |
for Comment
daru_421fb9914c984e3d97b0c8ff0: I don't know this beautiful solution. It's Amazing!
|
July 25, 2014, 7:57 p.m. |
+ 1 |
for Comment
Vachenzo: Editor here: I don't remember where exactly I found it, but I basically googled the number of possib...
|
July 25, 2014, 4:27 a.m. |
+ 1 |
for Comment
PositronicLlama: That version is functionally similar but won't pass the unit tests, since they expect a list of list...
|
July 23, 2014, 3:08 a.m. |
+ 1 |
for Comment
veky: You know this is _not_ tail recursion, right? :-D
|
July 23, 2014, 3:03 a.m. |
+ 1 |
for Comment
veky: Ok, first: Too. Many. Comments. Really. This is not C, where you write the code primarily for the pr...
|
July 23, 2014, 12:04 a.m. |
+ 1 |
for Comment
luizpcf: Very good approach but not for this category.
|
July 23, 2014, 12:03 a.m. |
+ 1 |
for Comment
Filipizaum: I always think how awesome 2 lines do the same as mine 20!!!
|
July 23, 2014, 12:03 a.m. |
+ 1 |
for Comment
kozino: Hi. This is not necessary: (w1.endswith(w2) or w2.endswith(w1)). This will be enough: w1.endswith(w2...
|