ha

jhy 2024-01-29 19:42:20

#include<bits/stdc++.h> using namespace std; char a[20000]; int top = 0; int main() { string n; cin >> n; for(int i = 0; i < n.length();i++) { if(top == 0 || n[i] != a[top - 1]){ a[top++] = n[i]; }else if(n[i] == a[top - 1]){ top--; } } for(int i = 0;i < top;i++){ cout << a[i]; } return 0; }