
    In an adaptive learning platform, develop a function that identifies and upgrades a student to their next unmastered skill level, represented by finding and setting the leftmost zero in their binary mastery score to one. The mastery score is a binary number where each bit position represents mastery (1) or non-mastery (0) of specific sub-skills, ordered from most advanced to least advanced skills from left to right.
    

    
def set_left_most_unset_bit(n):
    """
    In an adaptive learning platform, develop a function that identifies and upgrades a student to their next unmastered skill level, represented by finding and setting the leftmost zero in their binary mastery score to one. The mastery score is a binary number where each bit position represents mastery (1) or non-mastery (0) of specific sub-skills, ordered from most advanced to least advanced skills from left to right.
    

    """
def set_left_most_unset_bit(n):
    """
    In an adaptive learning platform, develop a function that identifies and upgrades a student to their next unmastered skill level, represented by finding and setting the leftmost zero in their binary mastery score to one. The mastery score is a binary number where each bit position represents mastery (1) or non-mastery (0) of specific sub-skills, ordered from most advanced to least advanced skills from left to right.
    

    """
    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