Maximum Subarray Sum

  • + 3 comments

    IMHO this one is so difficult because the trick to beating the time limits is to know or recognize a mathematical property of an array of modulo prefix sums.

    Once you know that property you can use trees or a sorted array to search for the answer without testing every single permutation of sum[i][j].

    I feel like this property is not related to coding and should have been stated up front. Perhaps that was intentional and part of the challenge, but it's easy to waste a lot of time coding before realizing you have to solve a math riddle first.