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.
That is it!
I did not consider that case.
Thank you!
Hi everyone! I have troubles when I run this code, I pass all tests but when passing the number six
I get an error and I do not understand why as I think my code should work well. help me please,
I am very desperate. what i do is to count the number of bills of 25 i get and the change from 50
should be 1 bill and from 100 should be 3 bills. So I sum the number of 50s and three times 100s I get and then
see which one is bigger to return the result of the function
def tickets(people):
num_25 = 0
num_50 = 0
num_100 = 0
for i in range(len(people)):
if people[i] == 25:
num_25 = num_25 + 1
elif people[i] == 50:
num_50 = num_50 + 1
else:
num_100 = num_100 + 1
nec_25 = num_50 + 3 * num_100
if nec_25 < num_25 or nec_25 == num_25:
return 'YES'
else:
return 'NO'