Maximum subarray sum

In it maximumsum is being updated in j loop. Cannot it be updated in the k loop?

hello @rishabhindora
yeah you can do that. but that will just increase the number of comparsions.