Algorithms - Improved Maximum-Subarray problem