Maximum subarray sum not resolved

its giving wrong ans

Hey Piyush, this question has multiple testcases and you need to call max subarray sum for each of the testcase.

you are getting wrong answer because cs and ms calculated for 1 testcase are carried forward to next testcase.

just add a statement cs=0,ms=0 just after starting outermost for loop i.e. add this statement at line no 10

hey piyush, if your query is resolved. Please mark this doubt as resolved and rate me on the basis of your experience.
rating option will appear when to mark this doubt as resolved