Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std ;
- #define sz(s) int(s.size())
- typedef long long ll ;
- #define all(v) v.begin() , v.end()
- #define imax INT_MAX
- #define imin INT_MIN
- void ABDEL3AL () {
- ios_base::sync_with_stdio(false); cin.tie(nullptr) , cout.tie(nullptr) ;
- #ifndef ONLINE_JUDGE
- freopen("input.txt" , "r" , stdin) , freopen("output.txt" , "w" , stdout) ;
- #endif
- }
- int main() {
- ABDEL3AL() ;
- int n ; cin >> n ;
- string s ; cin >> s ;
- map <string , int> mp ;
- for (int i = 0; i < sz(s) - 1; i++)
- mp[s.substr(i , 2)]++ ;
- int Max = imin ;
- string ans ;
- for (auto& i : mp)
- if (i.second > Max) ans = i.first ;
- cout << ans ;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement