func_code_string: #include <bits/stdc++.h>   using namespace std;   const int MAX_N = 100005;   int cnt[MAX_N];   int main() {     cin.tie(0);     ios::sync_with_stdio(false);     int n;     cin >> n;     vector<int> vec(n);     for (int i = 0; i < (int)(n); ++i) {       cin >> vec[i];     }     int m1 = -1, m2 = -2;     int id1 = -1, id2 = -1;     for (int i = 0; i < (int)(n); ++i) {       if (vec[i] > m1) {         cnt[i] -= 1;         m2 = m1, id2 = id1;         m1 = vec[i], id1 = i;       } else if (vec[i] > m2) {         cnt[id1] += 1;         m2 = vec[i], id2 = i;       }     }     vector<pair<int, int> > res;     for (int i = 0; i < (int)(n); ++i) {       res.push_back(pair<int, int>(cnt[i], -vec[i]));     }     sort((res).begin(), (res).end(), greater<pair<int, int> >());     cout << -res[0].second <<   n ;     return 0;   }   