def algorithm_1(array: list) -> int:
    """
    Algorithm 1 - Brute Force

    A straightforward way to solve the problem is to go through all possible 
    subarrays, calculate the sum of values in each subarray and maintain the 
    maximum sum.

    The variables [i] and [j] fix the first and last index of the subarray, and 
    the sum of values is calculated to the variable [cur]. The variable [best] 
    contains the maximum sum found during the search.

    The time complexity of the algorithm is O(n^3), because it consists of 
    three nested loops that go through the input.
    """
    best = 0
    size = len(array)
    for i in range(0, size):
        for j in range(i, size):
            curr = 0  # sum of current subarray
            for k in range(i, j):
                curr += array[k]
            best = max(best, curr)

    return best