def max_sub_array_sum(array, number):
    """
    Time: O(n)
    Space: O(1)
    Finds a the maximum sum of a 'number' consecutive elements in an array
    :param array: float or int
    :param number: float or int
    :return: float or int, highest sum
    """
    if not array:
        return None

    maximum = 0

    temp = 0
    for index, integer in enumerate(array):
        temp += integer

        if index-number >= 0:
            temp -= array[index-number]

        if temp > maximum:
            maximum = temp

    return maximum