Language: C++

using namespace std;
typedef long long ll;
const ll MOD=1000000007;
ll INF=300000;

int main(){
    ll N;
    cin>>N;
    string S;
    cin>>S;
    int Max=0;
    for(int i=0; i<N-1; i++){
        vector<pair<bool, bool>>  Jd(26);
        int Cou=0;
        for(int i=0; i<26; i++){
            Jd.at(i).first=false;
            Jd.at(i).second=false;
        }
        for(int j=0; j<=i; j++){
            Jd.at(S.at(j)-'a').first=true;
        }
        for(int j=i+1; j<N; j++){
            Jd.at(S.at(j)-'a').second=true;
        }
        for(int i=0; i<26; i++){
            if(Jd.at(i).first&&Jd.at(i).second){
                Cou ++;
            }
        }
        Max=max(Max, Cou);
    }
  	cout<<Max<<endl;
  return 0;
}

Compiler output:
a.cc: In function 'int main()':
a.cc:8:5: error: 'cin' was not declared in this scope
    8 |     cin>>N;
      |     ^~~
a.cc:1:1: note: 'std::cin' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
  +++ |+#include <iostream>
    1 | using namespace std;
a.cc:9:5: error: 'string' was not declared in this scope
    9 |     string S;
      |     ^~~~~~
a.cc:1:1: note: 'std::string' is defined in header '<string>'; this is probably fixable by adding '#include <string>'
  +++ |+#include <string>
    1 | using namespace std;
a.cc:10:10: error: 'S' was not declared in this scope
   10 |     cin>>S;
      |          ^
a.cc:13:9: error: 'vector' was not declared in this scope
   13 |         vector<pair<bool, bool>>  Jd(26);
      |         ^~~~~~
a.cc:1:1: note: 'std::vector' is defined in header '<vector>'; this is probably fixable by adding '#include <vector>'
  +++ |+#include <vector>
    1 | using namespace std;
a.cc:13:16: error: 'pair' was not declared in this scope
   13 |         vector<pair<bool, bool>>  Jd(26);
      |                ^~~~
a.cc:1:1: note: 'std::pair' is defined in header '<utility>'; this is probably fixable by adding '#include <utility>'
  +++ |+#include <utility>
    1 | using namespace std;
a.cc:13:21: error: expected primary-expression before 'bool'
   13 |         vector<pair<bool, bool>>  Jd(26);
      |                     ^~~~
a.cc:16:13: error: 'Jd' was not declared in this scope
   16 |             Jd.at(i).first=false;
      |             ^~
a.cc:20:13: error: 'Jd' was not declared in this scope
   20 |             Jd.at(S.at(j)-'a').first=true;
      |             ^~
a.cc:23:13: error: 'Jd' was not declared in this scope
   23 |             Jd.at(S.at(j)-'a').second=true;
      |             ^~
a.cc:26:16: error: 'Jd' was not declared in this scope
   26 |             if(Jd.at(i).first&&Jd.at(i).second){
      |                ^~
a.cc:30:13: error: 'max' was not declared in this scope; did you mean 'Max'?
   30 |         Max=max(Max, Cou);
      |             ^~~
      |             Max
a.cc:32:9: error: 'cout' was not declared in this scope
   32 |         cout<<Max<<endl;
      |         ^~~~
a.cc:32:9: note: 'std::cout' is defined in header '<iostream>'; this is probably fixable by adding '#include <iostream>'
a.cc:32:20: error: 'endl' was not declared in this scope
   32 |         cout<<Max<<endl;
      |                    ^~~~
a.cc:1:1: note: 'std::endl' is defined in header '<ostream>'; this is probably fixable by adding '#include <ostream>'
  +++ |+#include <ostream>
    1 | using namespace std;