
    Given the number of waiting passengers at a bus stop, determine the smallest bus capacity (which must be a power of 2) that can accommodate all passengers without overcrowding. The bus fleet consists of vehicles with seat capacities of powers of 2 (such as 16, 32, 64, etc.), and you need to select the most efficient option that minimizes empty seats while ensuring all passengers can be transported.
    

    
def next_power_of_2(n):
    """
    Given the number of waiting passengers at a bus stop, determine the smallest bus capacity (which must be a power of 2) that can accommodate all passengers without overcrowding. The bus fleet consists of vehicles with seat capacities of powers of 2 (such as 16, 32, 64, etc.), and you need to select the most efficient option that minimizes empty seats while ensuring all passengers can be transported.
    

    """
def next_power_of_2(n):
    """
    Given the number of waiting passengers at a bus stop, determine the smallest bus capacity (which must be a power of 2) that can accommodate all passengers without overcrowding. The bus fleet consists of vehicles with seat capacities of powers of 2 (such as 16, 32, 64, etc.), and you need to select the most efficient option that minimizes empty seats while ensuring all passengers can be transported.
    

    """
    if n and (not n & n - 1):
        return n
    count = 0
    while n != 0:
        n >>= 1
        count += 1
    return 1 << count