### The Story:
Bob is working as a bus driver. However, he has become extremely popular amongst the city's residents. With so many passengers wanting to get aboard his bus, he sometimes has to face the problem of not enough space left on the bus! He wants you to write a simple program telling him if he will be able to fit all the passengers.

### Task Overview:

You have to write a function that accepts three parameters: 
* `cap` is the amount of people the bus can hold excluding the driver.
* `on` is the number of people on the bus.
* `wait` is the number of people waiting to get on to the bus. 

If there is enough space, return 0, and if there isn't, return the number of passengers he can't take.

### Usage Examples:

```python
enough(10, 5, 5)
0 # He can fit all 5 passengers
enough(100, 60, 50)
10 # He can't fit 10 out of 50 waiting
```

```if:csharp
Documentation:
Kata.Enough Method (Int32, Int32, Int32)

Returns the number of passengers the bus cannot fit, or 0 if the bus can fit every passenger.

Syntax


public
static
int Enough(
int cap,
    int on,
int wait
    )
  



Parameters

cap

Type: System.Int32
The amount of people that can fit on the bus excluding the driver.

on

Type: System.Int32
The amount of people on the bus excluding the driver.

wait

Type: System.Int32
The amount of people waiting to enter the bus.

Return Value

Type: System.Int32
  An integer representing how many passengers cannot fit on the bus, or 0 if every passenger can fit on the bus.

```

Difficulty: introductory

Starter code:

def enough(cap, on, wait):
	

Solutions:
def enough(cap, on, wait):
    return max(0, wait - (cap - on))

def enough(cap, on, wait):
    return max(0, on + wait - cap)

def enough(cap, on, wait):
    return wait + on - cap if wait + on > cap else 0

def enough(cap, on, wait):
    return max(on + wait - cap, 0)

def enough(cap, on, wait):
    if cap-on>=wait:
        return 0
    else:
        return abs(cap-(on+wait))

def enough(cap, on, wait):
  rem=cap-on
  if wait<=rem:
   return 0
  else :
   return wait-rem
a=enough(5,3,2)
if a==0:
 print("Yes.Bob can take all passengers with him")
else :
 print(("Woops.Bob can't able to take ",a," passengers into the bus"))
   


enough = lambda c,o,w: max(0, w-(c-o))

def enough(cap, on, wait):
    return max(wait + on - cap, 0)

def enough(cap, on, wait):
    res = cap-(on+wait)
    return [0, abs(res)][res<0]

def enough(cap, on, wait):
    # Your code here
    if on + wait > cap:
        missed_out = on + wait - cap
    else:
        missed_out = 0
    return missed_out

def enough(cap, on, wait):
# See if there is enough room
    if cap - on >= wait:
        return 0                  # This means enough room for those waiting
    else:
        return wait - cap + on    # This is the number of those who cannot get on

def enough(cap, on, wait):
    '''
    :param cap: total number of seats
    :param on: number of passengers on the bus
    :param wait: number of passengers waiting for the bus
    :return: number of passengers that can't enter the bus
    '''
    if wait - (cap - on) < 0:
        return 0
    else:
        return wait - (cap - on)

def enough(cap, on, wait):
    return abs(cap-(on+wait) if cap<(on+wait) else 0)


def enough(cap, on, wait):
    remainingCapacity = cap - on
    if remainingCapacity <= wait:
        return (wait - remainingCapacity)
    else:
        return 0

def enough(cap, on, wait):
    return abs(min(cap - on - wait, 0))

def enough(cap, on, wait):
    return 0 if cap - on >= wait else wait - cap + on

enough = lambda cap, on, wait: 0 if cap - on - wait >= 0 else abs(cap - on - wait)

def enough(cap, on, wait):
    return -min(0, cap-(on+wait))

def enough(cap, on, wait):
    # Your code here
    import math
    if cap>=(on+wait):
        return 0
    elif cap<(on+wait):
        return abs((cap-(wait+on)))

def enough(cap, on, wait):
    a=cap-on
    if a>=wait:
        return 0
    else:
        b=wait-a
        return b

def enough(cap, on, wait):
    answer = on + wait - cap
    if answer < 0:
        return 0
    else:
        return answer

def enough(cap, on, wait):
    cap -= on
    if wait-cap <= 0:
        return 0
    else:
        return wait-cap

def enough(cap, on, wait):
    c=wait-(cap-on)
    if c<0:
        return 0
    return c
    # Your code here


def enough(cap, on, wait):
    num = cap - on
    if num == wait:
        return 0
    if wait > num:
        return (wait-num)
    else:
        return 0

def enough(cap, on, wait):
    return 0 if cap >= (on+wait) else on+wait-cap

def enough(cap, on, wait):
    return (cap-on-wait)*-1 if cap-on-wait<=0 else 0

def enough(cap, on, wait):
    return 0 if cap >= on + wait else (on + wait) % cap

def enough(cap, on, wait):
    x = on + wait
    if x <= cap:
        return 0
    elif x > cap:
        return x - cap
    else:
        return 'Not Sure'


def enough(cap, on, wait):
    return wait - (cap-on) if wait - (cap-on) >= 0 else 0

def enough(cap, on, wait):
    cap_lef = cap - on
    still_wait = wait - cap_lef
    if still_wait > 0:
        return still_wait
    else:    
        return 0


enough=lambda c,o,w:0 if c-o>=w else w-(c-o)


def enough(cap, on, wait):
    # Your code here
    c=cap-on
    if(wait<=c):
        return 0
    else:
        return wait-c

def enough(cap, on, wait):
    return 0 if cap-on-wait > 0 else wait-cap+on

def enough(cap, on, wait):
    empty = cap - on
    return 0 if empty >= wait else wait - empty

def enough(cap, on, wait):
    if cap < on + wait:
        return wait-(cap-on)
    else:
        return 0

def enough(cap, on, wait):
    
    remaining = cap - (on+wait)
    return abs(remaining) if remaining < 0 else 0

def enough(cap, on, wait):
    r = on + wait - cap
    return 0 if r < 0 else r

def enough(cap, on, wait):
    cap = int(cap)
    on = int(on)
    wait = int(wait)
    
    if cap >= on + wait:
        return 0
    else:
        diff = on + wait - cap
        cap != on + wait
        return diff

def enough(cap, on, wait):
    if wait <= cap-on:
        return 0
    else:
        return abs(wait-(cap-on))

def enough(cap, on, wait):
    space = cap - on
    return wait - space if space < wait else 0

def enough(cap, on, wait):
    return(0 if cap>=on+wait else -cap+on+wait)

def enough(cap, on, wait):
    enough_space = on + wait - cap
    if enough_space <= 0:
        return 0
    else:
        return enough_space


def enough(cap, on, wait):
    return 0 if wait < cap - on else -(cap-on-wait)

def enough(cap, on, wait):
    print(cap,on,wait)
    return 0 if on+wait<=cap else on+wait-cap

def enough(cap, on, wait):
    if cap - on == wait:
        return 0
    elif cap - on < wait:
        return (cap - on - wait)*(-1)
    elif wait < cap - on:
        return 0

def enough(cap, on, wait):
    
    people_left = wait - (cap - on)
    
    if (people_left <= 0):
        return 0
    
    if people_left > 0:
        return people_left
        
   
    
    
    # Your code here


def enough(cap, on, wait):
    a = cap-on-wait
    if a >= 0:
        return 0
    else:
        return abs(a)
    # Your code here


def enough(cap, on, wait):
    if wait > cap - on:
        return on + wait - cap
    return 0

def enough(cap, on, wait):
    return -(cap-on-wait) if cap<=on+wait else 0

def enough(cap, on, wait):
    c = (cap - on) - wait
    if c == 0:
        return 0
    if c > 0:
        return 0 
    else: 
        return c * -1

def enough(cap, on, wait):
    free = cap-on
    return 0 if free >= wait else wait-free


def enough(cap, on, wait):
    x = cap - on - wait
    return x*-1 if x <= 0 else 0

def enough(cap, on, wait):
    cant=cap-on-wait
    if cant>=0:
        return 0
    else:
        return abs(cant)

def enough(cap, on, wait):
    if on + wait  <= cap:
        return 0
    else:
        rest = cap - (on + wait)
        return abs(rest)

def enough(cap, on, wait):
    num = wait - (cap - on) 
    if num >= 0:
        return num
    else:
        return 0

def enough(cap, on, wait):
    cant = cap - wait
    if on + wait > cap:
        a = cap - on - wait
        return abs(a)        
    else:
        return 0


def enough(cap, on, wait):
    resultado = (on + wait - cap)
    return resultado if resultado > 0 else 0
    # Your code here


def enough(cap, on, wait):
    return -(cap - (on + wait)) if (cap - (on + wait)) < 0 else 0

def enough(cap, on, wait):
    if on + wait > cap:
        return (cap - (on + wait)) * -1;
    return 0;

def enough(cap, on, wait):
    if cap-on+1>wait: return 0
    else:return wait-cap+on

def enough(cap, on, wait):
    # Your code here
    diff = cap-on-wait
    return 0 if diff >=0 else -diff

def enough(cap, on, wait):
    # Your code here
    c=cap-on
    if c<wait:
        return wait-c
    return 0

def enough(cap, on, wait):
    if cap - on >= wait: #capacity minus bus occupancy more or equal than of people waiting 
        return 0 #If there is enough space, return 0.
    else:
        return abs(cap - (on + wait)) #and if there isn't, return the number of passengers he can't take
                                      #abs() function: return absolute values of a num.


def enough(cap, on, wait):
    x = cap - on
    if x >= wait:
        return 0
    else:
        return wait - x

def enough(cap, on, wait):
    if cap - on - wait < 0:
        seats_left = cap - on
        return wait - seats_left
    else:
        return 0

def enough(cap, on, wait):
    return 0 if wait + on <= cap - 1 else wait + on - (cap)

def enough(cap, on, wait):
    difference = cap - on
    if difference < wait:
        return wait - difference
    return 0

def enough(cap, on, wait):
    if wait > cap-on:
        return wait + on - cap
    else:
        return 0

def enough(cap, on, wait):
    rest = on + wait - cap
    if rest <= 0:
        return 0
    return rest

def enough(c,n,w):
    x=w-(c-n)
    return x if x>0 else 0

def enough(cap, on, wait):
    return wait - cap + on if wait - cap + on > 0 else 0

def enough(cap, on, wait):
    if cap == on + wait or cap > on + wait:
        return 0
    else:
        return abs(cap - (on + wait))

def enough(cap, on, wait):
    takes = cap - on - wait
    return 0 if takes>=0 else -(takes)
    # Your code here


def enough(cap, on, wait):
    x = wait - cap + on
    return x if x > 0 else 0

def enough(cap, on, wait):
    available = cap - on
    return max(wait-available, 0)

def enough(cap, on, wait):
    return 0 if cap - on - wait > 0 else (cap - on - wait) * -1

def enough(cap, on, wait):
    n=0
    if cap>=on+wait:
        return 0
    else:
        n=cap-on-wait
        return abs(n)
    # Your code here


def enough(cap, on, wait):
    a = cap - on - wait
    if a >= 0: return 0
    else: return a * -1

def enough(cap, on, wait):
    r = cap - on - wait
    return [0,abs(r)][r<0]

def enough(cap, on, wait):
    remaining = cap - on
    
    if remaining >= wait:
        return 0
    else:
        return wait - remaining

def enough(cap, on, wait):
    print(cap,on,wait)
    if on + wait > cap :
        return -cap+(on+wait)
    else:
        return 0

def enough(cap, on, wait):
    seat = (cap - on) - wait

    return 0 if seat >= 0 else abs(seat)

def enough(cap, on, wait):
    return wait - (cap - on) if on + wait > cap else 0

def enough(cap, on, wait):
    """ return wait list if bus is full"""
    wait_list = on + wait - cap
    return (wait_list > 0) * wait_list

def enough(cap, on, wait):
    print(cap, on, wait)
    return 0 if wait <= cap-on else wait-(cap- on ) 

def enough(cap, on, wait):
    if on >= cap:
        return wait
    spots = cap - on
    if spots >= wait:
        return 0
    return wait - spots



def enough(maximal, drin, warten):
    pers = drin + warten
    
    if pers <= maximal:
        return 0 
    elif pers > maximal:
        return pers - maximal

def enough(cap, on, wait):
    # Your code here
    cap -= on
#     if cap>=wait:
#         return 0
#     else:
#         return wait-cap
    return max(wait-cap, 0)

def enough(cap, on, wait):
    return (on+wait-cap) * (on + wait > cap)

def enough(cap, on, wait):
    return 0 if cap-on-wait>0 else abs(cap-on-wait) if cap-on-wait<0 else 0

def enough(cap, on, wait):
    n = (on + wait)
    if cap > n:
        return 0 
    return (on + wait) - cap

def enough(cap, on, wait):
    total = on + wait
    return 0 if cap >= total else abs(cap - total)

def enough(cap, on, wait):
    return 0 if cap > on + wait else wait + on - cap

def enough(cap, on, wait):
    return abs(on + wait - cap) if cap < on + wait else 0

def enough(cap, on, wait):
    return  0 if cap%(on+wait)  == 0 or (on+wait) < cap else (on+wait)-cap



def enough(cap, on, wait):
    if on + wait == cap:
       return 0
    elif on + wait > cap:
       return wait - (cap - on)
    else:
       return 0

def enough(cap, on, wait):
    b = -(cap - on - wait)
    return 0 if cap - (on + wait) >= 0 else b

exec("""\ndef enough(cap, on, wait):\n    a = on + wait\n    b = cap - a \n    if b >= 0:\n        return 0\n    else:\n        return abs(b)\n""")

def enough(cap, on, wait):
    a = on + wait
    b = cap - a 
    if b >= 0:
        return 0
    else:
        return abs(b)

def enough(cap, on, wait):
    return 0 if cap - on - wait >= 0 else wait + on - cap