DEV Community

Discussion on: Daily Challenge #280 - Driving School

Collapse
 
masterroshan profile image
TJ Johnson

Here's something fun, there is a set of numbers where this doesn't work, anyone up for finding it?

def cost(minutes):
    a = (minutes > 5)*30
    b = ((minutes // 30) & 1020)*10
    c = (minutes % 30 > 5 and minutes > 65)*10
    return a + b + c