https://ideas.creativecasinoties.com/post/kadanes-algorithm-6osv7o