Amazon interview question

Maximum subarray problem: complexity and pseudo code