Submission

Status:

PPPPPPPPPP

Subtask/Task Score:

100/100

Score: 100

User: Krovmoroz

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

Language: cpp

Time: 0.003 second

Submitted On: 2025-11-05 08:37:06

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

string s;
char m = '[';
unordered_map<char,int> freq;

int main() {
  ios::sync_with_stdio(false); cin.tie(nullptr);
  cin >> s;
  
  for (char c:s) freq[c]++;
  
  for (char c:s) if (c < m && freq[c] == 1) m = c;
  
  cout << m;
}