Solved MaxDoubleSliceSum in java