Question: 
Write a python function to set the left most unset bit.


Model's Code:
def set_left_most_unset_bit(n):
    if n == 0:
        return 1
    pos = 0
    temp = n
    while temp > 0:
        temp >>= 1
        pos += 1
    return n | (1 << (pos - 1))



Sample Correct Code:
def set_left_most_unset_bit(n): 
    if not (n & (n + 1)): 
        return n 
    pos, temp, count = 0, n, 0 
    while temp: 
        if not (temp & 1): 
            pos = count      
        count += 1; temp>>=1
    return (n | (1 << (pos))) 


Asserts:
assert set_left_most_unset_bit(10) == 14
assert set_left_most_unset_bit(12) == 14
assert set_left_most_unset_bit(15) == 15


Tests:
Test 1 of 3: FAIL: AssertionError()

Test 311 of 974: 224/311 (72.02572347266882%): failed