add another method to solve the max_subarray problem