You are viewing a single comment's thread. Return to all comments →
C++ Solution :
#include <iostream> #include <cmath> #include <string> #include <string.h> #include <stdlib.h> #include <algorithm> #include <iomanip> #include <assert.h> #include <vector> #include <cstring> #include <map> #include <deque> #include <queue> #include <stack> #include <sstream> #include <cstdio> #include <cstdlib> #include <ctime> #include <set> #include <complex> #include <list> #include <climits> #include <cctype> #include <bitset> #include <numeric> #include<array> #include<tuple> #include <utility> #include <functional> #include <locale> using namespace std ; int main() { string s ; cin >> s ; sort(s.begin(),s.end()) ; vector<int> v ; int counter = 1 ; int flag = 0 ; for(int i=0 ; i<s.size();i++) { if(s[i]==s[i+1]) counter++ ; else { if(counter%2!=0) flag++ ; counter = 1 ; } } (flag>1) ? cout << "NO" << endl : cout << "YES" << endl ; }
Seems like cookies are disabled on this browser, please enable them to open this website
Game of Thrones - I
You are viewing a single comment's thread. Return to all comments →
C++ Solution :