https://ideas.creativecasinoties.com/post/kadanes-algorithm-finding-the-maximum-subarray-sum-ndogu3