Facebook
From amsen, 11 Months ago, written in C++.
Embed
Download Paste or View Raw
Hits: 81
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. typedef pair<int, int> ii;
  5. typedef long long ll;
  6.  
  7. signed main(){
  8.         ios_base::sync_with_stdio(false);cin.tie(NULL);
  9.     int n;cin >> n;
  10.     string s;cin >> s;
  11.     int cnt[30] = {};
  12.     for(auto c : s)
  13.         cnt[c - 'a'] ++;
  14.     cout << *max_element(cnt, cnt+30) << "\n";
  15. }
  16.  
  17.