For this Question: You are given a stream of integers represented by an array <b>arr[]</b> of size <b>N</b>. Whenever you encounter an element arr[i], you need to increment its <b>first occurrence</b>(on the left side)if present in the stream by 1 and append this element in the array. You don't have to do this when you encounter arr[i] for the first time as it is the only occurrence till then. Finally, you need to print the updated array.The input line contains T, denoting the number of testcases. Each testcase contains two lines. First line contains N, size of array. Second line contains elements of array separated by space.

<b>Constraints:</b>
1 <= T <= 100
1 <= N <= 10^4
1 <= arr[i] <= 10^5
For each testcase you need to print the updated array in a new line.Input:
1
10
1 2 3 2 3 1 4 2 1 3

Output:
4 5 3 2 3 2 4 2 1 3

Explanation:
Testcase 1: We encounter 1, 2, 3.  We encounter 2 again so we increment its leftmost occurrence by 1. The updated array becomes 1 3 3 2. We encounter 3 next. So we increment its left most occurrence by 1. So updated array is 1 4 3 2 3. Next we encounter 1, so we increment the leftmost occurrence of 1 by 1. New updated array is 2 4 3 2 3 1. Next we encounter 4, so we do the same and increase its first occurrence by 1. New updated array is. 2 5 3 2 3 1 4. Next we encounter 2, so we do the same and increase its first occurrence by 1. New updated array is. 3 5 3 2 3 1 4 2. Next we encounter 1, so we do the same and increase its first occurrence by 1. New updated array is 3 5 3 2 3 2 4 2 1. Next we encounter 3, so we do the same and increase its first occurrence by 1. New updated array is 4 5 3 2 3 2 4 2 1 3. , I have written this Solution Code: #include <bits/stdc++.h>
using namespace std;
void solve(){
int n;//size of array
cin>>n;
int arr[n];//intitializing array
unordered_map<int,set<int>> first_occur;
for(int i=0;i<n;i++){
        cin>>arr[i];
if(first_occur.find(arr[i])==first_occur.end()){
        first_occur[arr[i]].insert(i);//check if element is repeated or not
}
else {
        arr[*first_occur[arr[i]].begin()]++;//increasing element which occured first
        first_occur[arr[i]+1].insert(*first_occur[arr[i]].begin());//adding index of first occurance to the increased element
        first_occur[arr[i]].erase(first_occur[arr[i]].begin());// deleting first occurance index
        first_occur[arr[i]].insert(i);// adding the current index to the current element
}
}
// print array
for(int i=0;i<n;i++){
    cout<<arr[i]<<" ";
}
}

int main(){
    int t;
    cin>>t;
    while(t--){
solve();
cout<<endl;}
}
, In this Programming Language: C++, Now tell me if this Code is compilable or not?