My issue
My code
#include <bits/stdc++.h>
#define int long long int
using namespace std;
int32_t main() {
// your code goes here
int t;
cin >> t;
while(t--){
string s;
cin >> s;
set<int>st;
int a= 1;
st.insert(a);
int i=0;
while(i<s.size()){
if(s[i]== '>') a--;
else if(s[i]== '<') a++;
st.insert(a);
i++;
}
cout << st.size() << endl;
}
return 0;
}
Problem Link: CHEFSIGN Problem - CodeChef