For this Question: Given an integer array where every element appears an even number of times, except one element which appears an odd number of times. If the identical elements appear in pairs in the array and there cannot be more than two consecutive occurrences of an element, find the odd occurring element.The first line contains a single integer N.
The second line contains N space- separated integer A[i].

<b>Constraints</b>
1 &le; N &le; 10<sup>4</sup>
1 &le; arr[i] &le; 10<sup>3</sup>Print odd occurring element.Sample Input 1: 
5
5 5 3 4 4

Sample Output 1: 
3
 
Sample Input 2: 
5
1 1 4 4 16

Sample Output 2:
16, I have written this Solution Code: #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int findOddOccuring(vector<int> nums)
{
    sort(nums.begin(), nums.end());
    int i = 0;
    while (i < nums.size())
    {
        int curr = nums[i];
        int count = 0;
        while (i < nums.size() && nums[i] == curr)
        {
            count++;
            i++;
        }
        if (count & 1) {
            return curr;
        }
    }
    return -1;
}
int main()
{
	int n;
	cin>>n;
	vector<int>nums(n);
	for(int &i:nums)cin>>i;
    cout <<findOddOccuring(nums);
    return 0;
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?