Submission

Status:

P-PP-PPP--

Subtask/Task Score:

60/100

Score: 60

User: chypnx

Problemset: ตัวอักษรตัวแรกในคำ

Language: cpp

Time: 0.003 second

Submitted On: 2025-10-03 16:56:13

#include <bits/stdc++.h>
using namespace std;

int main(){
    string txt;
    cin >> txt;

    sort(txt.begin(),txt.end());

    if (txt.length() == 1){
        cout << txt[0];
    }else{
        for(int i =1; i< txt.length(); i++){
            if(txt[i] == txt[i-1]){
                txt.erase(i-1,2);
            }
        }
        cout << txt[0];
    }

 return 0;
}