
    Given a sorted list of user interaction scores with various content categories, determine if a specific interest category dominates the user's social activity profile. An interest category is considered dominant if it appears in more than half of the user's total recorded interactions. Write a function that accepts the sorted interaction scores, the total number of interactions, and the target interest category as input parameters and returns whether that category represents the user's primary interest.
    

    
def binary_search(arr, low, high, x):
    if high >= low:
        mid = (low + high) // 2
        if (mid == 0 or x > arr[mid - 1]) and arr[mid] == x:
            return mid
        elif x > arr[mid]:
            return binary_search(arr, mid + 1, high, x)
        else:
            return binary_search(arr, low, mid - 1, x)
    return -1

def is_majority(arr, n, x):
    """
    Given a sorted list of user interaction scores with various content categories, determine if a specific interest category dominates the user's social activity profile. An interest category is considered dominant if it appears in more than half of the user's total recorded interactions. Write a function that accepts the sorted interaction scores, the total number of interactions, and the target interest category as input parameters and returns whether that category represents the user's primary interest.
    

    """
def binary_search(arr, low, high, x):
    if high >= low:
        mid = (low + high) // 2
        if (mid == 0 or x > arr[mid - 1]) and arr[mid] == x:
            return mid
        elif x > arr[mid]:
            return binary_search(arr, mid + 1, high, x)
        else:
            return binary_search(arr, low, mid - 1, x)
    return -1

def is_majority(arr, n, x):
    """
    Given a sorted list of user interaction scores with various content categories, determine if a specific interest category dominates the user's social activity profile. An interest category is considered dominant if it appears in more than half of the user's total recorded interactions. Write a function that accepts the sorted interaction scores, the total number of interactions, and the target interest category as input parameters and returns whether that category represents the user's primary interest.
    

    """
    i = binary_search(arr, 0, n - 1, x)
    if i == -1:
        return False
    if i + n // 2 <= n - 1 and arr[i + n // 2] == x:
        return True
    else:
        return False