A solution of maximum subarray problem