https://medium.com/@divyanshpandey0108/mastering-kadanes-algorithm-the-key-to-solving-maximum-subarray-problems-3139b680e911