Update minimum difference and starting and ending indexes
if min_diff > diff : NEW_LINE INDENT min_diff = diff NEW_LINE start = pre_sum [ i - 1 ] . index NEW_LINE end = pre_sum [ i ] . index NEW_LINE DEDENT