max subarray sol2 less memory solution