Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
I understand. I better check some books on efficient Python as my Python only brought me to 5 kyu. It seems like anything
above that will require different thinking.
The description doesn't say how many numbers the
list should consist of. As it is it could be infinite.
This comment is hidden because it contains spoiler information about the solution
The test is parsing an array [ 6, 0, 1, 10, 10 ] and it expects to get returned 17. 10 is undoubtedly the hightest
number there so my code removes both instances and the test won't pass.
It should be noted in the description of the challenge that the tests check for
order of the your words in the list. I've got a solution but need to redo it
because I've got the words in different order and it won't pass some of the tests.
Either make a note in the description saying the resulting list needs to be
in specified order or make the test order-insensitive.
This is funny. So how one supposed to come up with number of trailing zeros of a number if you can't have the number to begin with ? Duh ! Leaving this one.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This is not the first time when my code won't pass due to time out:
For those of you who are complaining about description not being clear enough. Fellow
coders you need to understand that if the description would be crystal clear all
coders would know exactly what's the required output and how to go about solving
it and hence it wouldn't qualify for 5 kyu rank. They would have to rank it down.
By not making the description crystal clear they're effectively making it harder
to work out 'coz you've got questions floating around your head ("do they mean this, or do they mean that..."
hence they can rank it up.
I'm with you on this one. The instructions clearly say we need to return the first two values from the left that add up to "s" and
it rejects 5 and 5 as a correct answer. As much as I respect this platform it's not flawless and you need to take
it that way.
This comment is hidden because it contains spoiler information about the solution
I'd suggest to reword "jump" in the instructions to "iterate back / iterate to" because I just created solution that jumps (skips)
the steps in between making it an infinite loop in result because when you jump back from [jnz c -5] to [dec a] and then back to [jnz c -5] you're effectively skipping the only step that can let the program proceed [dec c]. So now I need to change my solution so it iterates back and forth so the program can actualy find its end.
I completely missed the fact that I'm supposed to double the names !
Oh .. gosh ... I'm giving you permission to make fun of me for
the rest of the day. Now I know what to do!
This is not a working solution so please don't freak out.
I'm sharing it here because I like this block of code. It's only
few lines and very elegant if I may say. Strangely though, it
doesn't work. It doesn't return the word you're after. Theoritically speaking, it
should.
from collections import deque
def who_is_next(names, r):
#print(names, r)
r -= 1 # here I'm accounting for the fact that you need to decrease number
# of rotations by 1 in order to get the word you're after.
d = deque(names)
d.rotate(-r)
return d[0]
Loading more items...