https://ideas.creativecasinoties.com/post/ca-10-kadanes-algorithm-llidip