Submission

Status:

P-PPPPPP-P

Subtask/Task Score:

80/100

Score: 80

User: Bestzu

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

Language: cpp

Time: 0.004 second

Submitted On: 2025-10-07 15:43:19

#include <bits/stdc++.h>
#define endl '\n'
using namespace std;



int main() {
    ios::sync_with_stdio(false); cin.tie(0);
	
	string s; cin >> s;
	sort(s.begin(), s.end()) ;
	int n = s.size();
	
	int i = 1;
	while(i < n) {
		if(s[i] == s[i-1]) i++;
		else break;
	}
	(i == 1) ? cout << s[--i] : cout << s[i];
	return 0;
}