Find the Maximum Length of Valid Subsequence I
A valid subsequence keeps every neighbouring sum with the same parity, so it is either one parity class or an alternating run of parities.
A valid subsequence keeps every neighbouring sum with the same parity, so it is either one parity class or an alternating run of parities.