For this Question: Given an array of N numbers, and each number is present thrice in the array except for one element which is present only once. Find that element.

Note: Used extra space must be less than O(N). Use bit manipulation.First line contains a single integer N, denoting the number of elements.
Next line contains N integers A[i], denoting the elements of the array. 
It is guaranteed that all numbers appear thrice except one.

Constraints :
1 <= N <= 1e6
1 <= A[i] <= 1e8The element with frequency 1.Input:
10
1 1 1 2 3 3 3 4 4 4

Output:
2, I have written this Solution Code: #include<bits/stdc++.h>
using namespace std;

#define pu push_back
#define fi first
#define se second
#define mp make_pair
#define int long long
#define pii pair<int,int>
#define mm (s+e)/2
#define all(x) x.begin(), x.end()
#define For(i, st, en) for(int i=st; i<en; i++)
#define tr(x) for(auto it=x.begin(); it!=x.end(); it++)
#define fast std::ios::sync_with_stdio(false);cin.tie(NULL);
#define sz 200000
#define qw1 freopen("input1.txt", "r", stdin); freopen("output1.txt", "w", stdout);
#define qw freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);

int getSingle(int arr[], int n)  
{  
    // Initialize result  
    int result = 0;  
  
    int x, sum;  
  
    // Iterate through every bit  
    for (int i = 0; i < 32; i++)  
    {  
          
    // Find sum of set bits at ith position in all  
    // array elements  
    sum = 0;  
    x = (1 << i);  
    for (int j = 0; j < n; j++ )  
    {  
        if (arr[j] & x)  
            sum++;  
    }  
  
    // The bits with sum not multiple of 3, are the  
    // bits of element with single occurrence.  
    if (sum % 3)  
        result |= x;  
    }  
  
    return result;  
}  

signed main()
{
	
		int n;
		cin>>n;
		int A[n];
		for(int i=0;i<n;i++)
		{
			cin>>A[i];
		}

		cout<<getSingle(A,n);
	
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?