Find the position of the number whose parity differs from the rest.
You are given an array of integers. All numbers are of the same parity except one: either exactly one number is even while all others are odd, or exactly one number is odd while all others are even.
Your task is to determine the 1-based index of that different number.
Example 1
Input
5 2 4 7 8 10
Output
3
Explanation
All numbers are even except 7, which is at position 3.
Example 2
Input
3 9 2 1
Output
2
Explanation
Only 2 is even; the others are odd.
Premium problem context
Premium adds guided hints, editorial links, similar variants, discussion resources, and concept maps so you can understand why a problem matters, not just solve it once.