
    In an adaptive learning system, given a student's current skill mastery profile represented as a binary number n (where 1 indicates mastery and 0 indicates non-mastery of specific sub-skills), develop a function that identifies and activates the next available skill level by setting the leftmost unmastered skill (0 bit) to mastered (1 bit). The function should maintain the existing mastery status of all other skills while enabling progressive skill advancement.
    

    
def set_left_most_unset_bit(n):
    """
    In an adaptive learning system, given a student's current skill mastery profile represented as a binary number n (where 1 indicates mastery and 0 indicates non-mastery of specific sub-skills), develop a function that identifies and activates the next available skill level by setting the leftmost unmastered skill (0 bit) to mastered (1 bit). The function should maintain the existing mastery status of all other skills while enabling progressive skill advancement.
    

    """
def set_left_most_unset_bit(n):
    """
    In an adaptive learning system, given a student's current skill mastery profile represented as a binary number n (where 1 indicates mastery and 0 indicates non-mastery of specific sub-skills), develop a function that identifies and activates the next available skill level by setting the leftmost unmastered skill (0 bit) to mastered (1 bit). The function should maintain the existing mastery status of all other skills while enabling progressive skill advancement.
    

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