Given a circular array of N integers (that is, A[0] and A[N - 1] are adjacent to each other), what's the maximum number of adjacent pairs that you can form whose sum are even? Note that each element can belong to at most one pair.
For example, if we have [5, 7, 9, 6, 3], then you should pair (5, 3) and (7, 9) to achieve the answer of two. Also, if we have [1, 1, 1, 1, 1, 1], then the answer is 3 (pair each adjacent element without wrapping around)
Couldn't solve this problem. Can anyone come up with answer?