MAXIMUM SUBARRAY SUM(Test case failing)

question: https://hack.codingblocks.com/contests/c/522/851
answer: https://ide.codingblocks.com/#/s/28321

  • You need to use Divide and Conquer for this problem
  • You’re not only not using it, but also not implementing Kadane’s properly.
  • As you encounter a negative number, you make the sum 0, which is wrong. e.g. For 2 5 -1 4, the answer will be 10 not 7