For this Question: Given a string s, your task is to divide the string in as many parts as it is possible such that a character can only be present in at most 1 part.Input contains a single string S.

Constraints:-
1 < = N < = 100000

Note:-
String will contain only lowercase english alphabetsPrint the maximum number of partitions.Sample Input:-
abcdaefghgheklmnol

Sample Output:-
4

Explanation:-
abcda efghghe k lmnol

Sample Input:-
newtonschool

Sample Output:-
2

Explanation:-
newtonschoo l, I have written this Solution Code: #include <bits/stdc++.h>


using namespace std;

#define MEM(a, b) memset(a, (b), sizeof(a))

#define FOREACH(it, l) for (auto it = l.begin(); it != l.end(); it++)

#define IN(A, B, C) assert( B <= A && A <= C)

#define MP make_pair
#define FOR(i,a) for(int i=0;i<a;i++)

#define FOR1(i,j,a) for(int i=j;i<a;i++)

#define EB emplace_back

#define INF (int)1e9

#define EPS 1e-9

#define PI 3.1415926535897932384626433832795
#define max1 200001
#define MOD 1000000007

#define read(type) readInt<type>()
#define int long long
#define out(x) cout<<x<<'\n'
#define out1(x) cout<<x<<" "
#define END cout<<'\n'

void fast(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
}
int m[100001];

signed main(){



    string s;
    cin>>s;
    int last[26];
    FOR(i,26){last[i]=0;}
    FOR(i,s.length()){last[s[i]-'a']=i;}

        int j = 0, ans=0;
        for (int i = 0; i < s.length(); ++i) {
            j = max(j, last[s[i] - 'a']);
            if (i == j) {
                    ans++;
            }
        }
        out(ans);
}
, In this Programming Language: C++, Now tell me if this Code is compilable or not?