It shows TLE error

For finding the maximum subarray sum, I have used the efficient cumulative sum concept which was taught earlier.
Any other better solution? And I have attached code snippet below.

hi @esaidaw_d58bc806ffa757ae solve using kadane’s algorihm
refer kadane --> https://www.geeksforgeeks.org/largest-sum-contiguous-subarray/

code -->