2018.3-29华为实习编程题,最后一个题,求解答
昨天晚上华为笔试题,使用python始终不AC最后还是,问一下大牛,一直报的是强制转换的错误,请问大佬有什么问题吗??,修改一下
def FindGreatestSumOfSubArray(array): # write code here max_sum, cur_sum = -0xffffff, 0 for i in array: if cur_sum <= 0: cur_sum = i else: cur_sum += i if cur_sum > max_sum: max_sum = cur_sum return max_sum if __name__ == '__main__': a = list(map(int, input().split(','))) print(FindGreatestSumOfSubArray(a))
#实习##华为#