Bharti Airtel interview question

Problems based on Kadane's algorithm, two pointers