• + 3 comments
    appleno = 0
    orangeno = 0
    for no in apple:
        if (no + a) in range(s,t+1):
            appleno += 1
    for no in orange:
        if (no + b) in range(s,t+1):
            orangeno += 1
    print appleno
    print orangeno
    

    It says timed out. Can you tell me why. I have changed it to no+a >= s and no+a <= t. But i need to know why the former one doesn't work. Thank you