Submission

Status:

PPPPPPPP-P

Subtask/Task Score:

90/100

Score: 90

User: chypnx

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

Language: cpp

Time: 0.003 second

Submitted On: 2025-10-04 08:32:34

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

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

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

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

 return 0;
}