• + 1 comment

    While this works because you're adding n negative numbers (which will always be less than the positive number k), it's kind of an odd way to think about it. I think counting the number of on-time students would make more sense.

    print( "YES" if len([1 for x in a if x <= 0]) >= k else "NO")