https://codeanddebug.in/blog/maximum-subarray-kadanes-algorithm/