We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- Algorithms
- Search
- Maximum Subarray Sum
- Discussions
Maximum Subarray Sum
Maximum Subarray Sum
Sort by
recency
|
334 Discussions
|
Please Login in order to post a comment
I was able to make a code that passes 11/19 cases in C#.
Without set clean code
Can someone explain me, why in the below Explanation in the third step is missing the subarray 3,9,5? which is 21 % 7 = 3 the largest sum
And how should it work if the array has 100000 elements? It will have millions of operations (subarrays) beginning first step with 99999 operations.
Hi devuy11, for test case #1.1, I got 1804272920, which is larger than expected output of 1802192837. I copied the input numbers in spreadsheet and verified my result. Here's the subset for which I got the max: 35005212,149798316,233665124,278722863,294702568,304089173,336465783,424238336,468703136,521595369,596516650,608413785,628175012,635723059,719885387,756898538,783368691,846930887,859484422,861021531,1025202363,1059961394,1102520060,1125898168,1129566414,1131176230,1189641422,1303455737,1315634023,1350490028,1365180541,1369133070,1540383427,1649760493,1653377374,1656478043,1681692778,1714636916,1726956430,1734575199,1801979803,1914544920,1957747794,1967513927,2038664371,2044897764,2089018457,2145174068 Could you please check. Thanks!