from typing import List


def brute_force_max_sum_subarray(array: List[int]) -> int:
    """
    A brute force O(n2) algorithm to solve the maximum subarray problem.
    :param array: the array to process
    :return: the maximum value amongst all consecutive subarrays

    >>> brute_force_max_sum_subarray([34, -50, 42, 14, -5, 86])
    137
    >>> brute_force_max_sum_subarray([-5, -1, -8, -9])
    0
    """
    if not array:
        return 0
    return max([sum(array[i1:i2]) for i1 in range(len(array)) for i2 in range(i1, len(array)+1)])