For this Question: Given an array <b>a</b> of n integers. Find the maximum value of <b>(i + j)</b> such that <b>1 &le; i < j &le; n and a[i] = a[j]</b>.The First line of the input contains n.
The next line contains n space-separated integers.

<b>Constraints</b>
1 &le; n &le; 10<sup>5</sup>
1 &le; a[i] &le; nOutput a single integer denoting maximum sum.Input:
6
2 3 1 2 3 5

Output:
7

Explanation:
for 2 => i = 1, j = 4 => i+j = 5
for 3 => i = 2, j = 5 => i+j = 7, I have written this Solution Code: #include <bits/stdc++.h>

using namespace std;

int main() {
    int n;
    cin >> n;
    map<int, priority_queue<int>> mp;
    for (int i = 0; i < n; i++) {
        int temp;
        cin >> temp;
        mp[temp].push(i + 1);
    }
    int maxi = 0;
    for (auto &i : mp) {
        if (i.second.size() >= 2) {
            int x = i.second.top();
            i.second.pop();
            int y = i.second.top();
            maxi = max(maxi, x + y);
        }
    }
    cout << maxi << "\n";
    return 0;
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?