Ad
  • Custom User Avatar

    is groupMapReduce() a new thing ?

  • Default User Avatar
  • Default User Avatar

    That is it!
    I did not consider that case.
    Thank you!

  • Default User Avatar

    Just a suggestion for those of you having trouble... A $50 bill does not equal two $25 bills. You have to think of each bill as a whole unit because you have an empty cash register, and can't make change until you're given it.

  • Default User Avatar

    I think that your problem probably stems from the fact that you can also give change for a $100 bill in the form of one $50 bill and one $25 bill (instead of three $25 bills).

  • Default User Avatar

    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'