For this Question: Aryan was given a string, He was asked to print the first and last repeated character in a string.The first line of the input contains a string str.

<b>Constraints</b>
1 &le; |str| &le; 10<sup>5</sup>Print the first and last repeated character of a string.Sample Input 
newtonschool

Sample Output
n o

Explanation
The first repeated character is n as it occurs 2 times in complete string and the last repeated character is o., I have written this Solution Code: #include <bits/stdc++.h>

using namespace std;

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 2351
#endif

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    auto start = std::chrono::high_resolution_clock::now();

    string str;
    cin >> str;
    map<char, int> freq;
    for (auto &i : str) {
        freq[i] += 1;
    }
    char first = '1', last;
    for (auto &i : str) {
        if (freq[i] > 1 && first == '1') {
            first = i;
            last = i;
            continue;
        }
        if (freq[i] > 1) {
            last = i;
        }
    }
    cout << first << " " << last << "\n";

    auto stop = std::chrono::high_resolution_clock::now();
    auto duration = std::chrono::duration_cast<std::chrono::nanoseconds>(stop - start);
    cerr << "Time taken : " << ((long double)duration.count()) / ((long double)1e9) << "s " << endl;
    return 0;
};
, In this Programming Language: C++, Now tell me if this Code is compilable or not?