Amazon Interview Question

Maximum subarray problem: complexity and pseudo code