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.
Can you please explain why it works?
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.
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
Why doesn't
x = str(1/0)
simply work?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.
how does it work? if the number is 18 for example, 18%9==0, while sum of digs should be 9.
thanks!
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Can someone please explain why this works? Thanks
Great solution.
Could you please explain what the complexity of this solution, and compare it to the complexity of iterating over the list?
Could someone please explain? Thanks!
What's the O(n^2) solution ?
This comment is hidden because it contains spoiler information about the solution
I may have it wrong, but I'm not sure this handles cases where the sum of the entire array is 0. When I ran this code for arrays like [-10,10] I get -1, where per the instructions the code should return 0.
In python, I'm seeing things I don't necessarily understand. LIke:
[25, 25, 25, 100]
Shoud equal NO.
But, in this case, I have $75 in the till when the person with the $100 comes, so I will have $75 to give back as change.
Help please?
Loading more items...