Spoj GSS1 problem

fucking gooood explanation.thanks for it

U used the term maximum sum subarray so does it means kadane’s algorithm??