Finding maximum sum of coherent substring of number sequence (SSP)