Coding Pattern: Kadane's Algo
Imagine you’re walking along a path that has treasure chests and traps. Some chests have gold coins, and some traps take away coins. You want to find the part of the path where you can get the most coins. The key idea: It is a dynamic programming algorithm for finding the maximum contiguous sum subarray in a given array. It is a simple and efficient algorithm that works by maintaining two variables:...