Given an array of n numbers, give an algorithm for finding a contiguous subsequence A(i) ...A(j) for which the sum of elements is maximum.
Eg. [-2, 11, -4, 13, -5, 2] → 20
If dynamic programming approach is used then what is time complexity and space complexity?
(a.) O(n3), O(1)
(b.) O(n), O(n)
(c.) O(n3), O(n)
(d.) O(n2), O(1)
Given answer is option (b.)