Input: arr[] = {2, 3, 4, 5}
Output:
6
6
Explanation: (2, 3), (2, 4), (2, 5), (4, 2), (4, 3) and (4, 5) are the pairs with even values
and (3, 2), (3, 4), (3, 5), (5, 2), (5, 3) and (5, 4) are the pairs with odd values.
Input: arr[] = {10, 11, 20, 60, 70}
Output:
16
4
Explanation: (10, 11), (10, 20), (10, 60), (10, 70), (20, 10), (20, 11), (20, 60), (20, 70), (60, 10), (60, 11), (60, 20), (60, 70), (70, 10), (70, 11), (70, 20), (70, 60) are the pairs with even values and (11, 10), (11, 20), (11, 60), (11, 70) are the pairs with odd values.