Company: MERCER
Difficulty: medium
Same-Parity Repeats You are given an integer array `A` of size `N`, representing the user interactions recorded by a data analytics firm. An analyst wants to know how many distinct values occur **more than once** while **all** of their occurrences sit at positions of the **same parity** - that is, every occurrence is at an even index, or every occurrence is at an odd index. Indices are **0-based**: `A[0]` is at index `0` (even), `A[1]` is at index `1` (odd), and so on. Count the distinct values `v` such that both of the following hold: 1. `v` appears at least twice in `A`; 2. all indices at which `v` appears have the same parity. Print that count. Input Line 1: a single integer N - the number of user interactions. Line 2: N space-separated integers A[0] A[1] ... A[N-1]. If `N` is such that the second line is empty it is still present (possibly blank). Output A single line containing one integer: the number of distinct values that satisfy both conditions. Constraints `1 <= N <= 15