Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: Nuttykub

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

Language: cpp

Time: 0.002 second

Submitted On: 2026-10-01 14:30:23

#include <bits/stdc++.h>
using namespace std;
int main(){
    string s;
    cin >> s;
    sort(s.begin(),s.end());
    vector<bool> found(26,false);
    for (int i  =0;i< s.length()-1;i++){
        if (s[i] != s[i+1] and !found[s[i]-'A']) {
            cout << s[i];
            return 0;
        }
        else found[s[i]-'A'] = true;
    }
}