This code is showing tle,what can be more efficient than this

What is wrong in this code…

What is wrong in this code… https://onlinegdb.com/rkUWexaCI

It is showing wrong answer for all test case

hello @ashishnnnnn
a)u r not reinitialising ur cur sum

b)initialise ur max=b[0] (doing this will handle negative case as well.)

Thank…I got both the points…

I should try to find it by myself, rather than asking quickly.I will try this.