Skip to content

Instantly share code, notes, and snippets.

@qjatn0120
Created November 21, 2022 17:43
Show Gist options
  • Save qjatn0120/e32eb3e7d799d72339d86b9fa3bf059e to your computer and use it in GitHub Desktop.
Save qjatn0120/e32eb3e7d799d72339d86b9fa3bf059e to your computer and use it in GitHub Desktop.
#include <bits/stdc++.h>
using namespace std;
int main(){
cin.tie(nullptr), ios::sync_with_stdio(false);
int t, n;
string s;
cin >> t;
while(t--){
cin >> n >> s;
int ans = 0;
for(char c : s) ans = max(ans, c - 'a' + 1);
cout <<ans << "\n";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment