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.
When I first saw this, I was like what??!! :D
face => palm
Can you please explain why it works?
added by someone
approved
fixed
Fork!
I just changed the comment on Python that read "#your code here; you can use % but your are lame if you do ;)". I think we should not be shaming beginners if they don't know how to do this or that.
What an ingenious way!!!
You need to consider that this scenario/position might not be possible at all because too many people would stand behind him in that case!
I don't get it.
If you're saying "no more than X people behind" that includes a scenario at the extreme where there are 0 people behind.
Similarly, when you say "No less than Y people ahead" that means that in the best possible scenario (for Vasya) there are exactly Y people ahead of him and no more.
Hence, the maximum number of options for Vasya should simply be p-Y.
However, this doesn't work. For example:
Test: Testing 9 people in line, at least 4 ahead, no more than 3 behind:
Answer: No more than 3 people after Vasya: 5 should equal 4
Help?
Thanks
Because in such case, exception does not originate from inside of
str
. It's raised beforestr
is executed.Why doesn't
x = str(1/0)
simply work?That's the idea. Most of these Katas are 7 Kyu and can be solved easily in some languages. For instance, this Kata is trivial in Python, Ruby and Haskell. It's much more difficult in Java, cpp, JS, and others that don't have in-built cartesian product methods because you must use two nested loops correctly.
As a general note, I dislike katas with "Simple" in the title. It may be simple for some, but others may struggle and the title puts added pressure on them.
Loading more items...