
    Design a function for a bank's transaction surveillance system that determines the minimum number of monitoring slots needed, where the number of slots must be a power of 2 and sufficient to handle n concurrent transactions. The system requires this power-of-2 sizing to optimize its binary tree-based fraud detection algorithms that process real-time transaction data across multiple accounts and locations.
    

    
def next_power_of_2(n):
    """
    Design a function for a bank's transaction surveillance system that determines the minimum number of monitoring slots needed, where the number of slots must be a power of 2 and sufficient to handle n concurrent transactions. The system requires this power-of-2 sizing to optimize its binary tree-based fraud detection algorithms that process real-time transaction data across multiple accounts and locations.
    

    """
def next_power_of_2(n):
    """
    Design a function for a bank's transaction surveillance system that determines the minimum number of monitoring slots needed, where the number of slots must be a power of 2 and sufficient to handle n concurrent transactions. The system requires this power-of-2 sizing to optimize its binary tree-based fraud detection algorithms that process real-time transaction data across multiple accounts and locations.
    

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