replace: ends with n and must replaced one
nonreplace: ends with n and must not replaced
for replace, there are three cases:
n * n: replace current n, and start this as new subarray.
n * n
n * n + nonreplace: replace current n and plus former nonreplace subarray.
n * n + nonreplace
n + replace: already replaced before and add current n to subarray.
n + replace
for nonreplace, there are only two cases:
n: n start as a new subarray.
n
n + nonreplace: n plus former nonreplace subarray.
n + nonreplace
Last updated 4 years ago