You are given an array of size N , then you are given N integers A[i] = i'th element .
You will have to process some query , Q . Two types of query :
1 — that means print the maximum sub array sum in this array .
2 p V — Update the value of index p to V ;
1 ≤ Q ≤ 100000
How to solve it efficiently ? I got TLE in test 4 .
Problem link: https://toph.co/p/problem---smsms
My code : https://ideone.com/GC3o8V