Problem 3201 · Medium

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.

Open the interactive visualisation