Alex is transitioning from website design to coding and wants to sharpen his skills with CodeWars.  
He can do ten kata in an hour, but when he makes a mistake, he must do pushups. These pushups really tire poor Alex out, so every time he does them they take twice as long. His first set of redemption pushups takes 5 minutes. Create a function, `alexMistakes`, that takes two arguments: the number of kata he needs to complete, and the time in minutes he has to complete them. Your function should return how many mistakes Alex can afford to make.

Difficulty: introductory

Starter code:

def alex_mistakes(number_of_katas, time_limit):
	

Solutions:
from math import log

def alex_mistakes(n, time):
    return int(log((time - n * 6) / 5 +1, 2))


def alex_mistakes(katas, time):
    mistakes = 0
    pushup_time = 5
    time_left = time - katas * 6
    
    while time_left >= pushup_time:
        time_left -= pushup_time
        pushup_time *= 2
        mistakes += 1
    return mistakes

from math import log

MINUTES_PER_KATA = 6.0
PUSHUPS_BASE_TIME = 5.0

def alex_mistakes(n_katas, time_limit):
    return int(log((time_limit - MINUTES_PER_KATA * n_katas) / PUSHUPS_BASE_TIME + 1, 2))

from math import log

def alex_mistakes(katas, limit):
    return int(log((limit - katas * 6 + 5) / 5, 2))


def alex_mistakes(number_of_katas, time_limit):
    req_time = 5
    sets = 0
    remaining = time_limit - number_of_katas * 6
    
    while remaining>=req_time:
        remaining-=req_time
        req_time*=2
        sets+=1
        
    return sets

def alex_mistakes(n, l):
    mistakes = 0
    push_time = 0
    while push_time < l - n * 6:
        push_time += 5*2**mistakes
        if push_time > l - n * 6: return mistakes
        mistakes += 1
    else: 
        return mistakes

import math

def alex_mistakes(number_of_katas, time_limit):
    return int(math.log(1 + (time_limit - number_of_katas * 6) / 5.0, 2))

import math

def alex_mistakes(number_of_katas, time_limit):
    return int(math.log((time_limit - number_of_katas * 6.0) / 5 + 1, 2))

def alex_mistakes(number_of_katas, time_limit):
    left = (time_limit - 6*number_of_katas) // 5
    bits = left.bit_length()
    if left + 1 == 1<<bits: return bits
    return bits - 1