Submission

Status:

[-SSSSSSSSS]

Subtask/Task Score:

{0/100}

Score: 0

User: Max

Problemset: ตรวจบัตรเครดิต

Language: cpp

Time: 0.002 second

Submitted On: 2025-10-13 20:44:35

#include <iostream>
#include <string>
#include <algorithm>
using namespace std;

int main(){
    string word;
    cin >> word;
    char alpa;
    int i, j, len, count;
    len = word.length();
    string toRemove = "";
    for (i=0; i<len; i++)
    {
        count = 0;
        alpa = word[i];
        for (j=0; j<len; j++)
        {
            if (alpa == word[j])
                count++;
        }
        if (count > 1)
        {
            toRemove += alpa;
        }
    }
    for (char c : toRemove)
        word.erase(remove(word.begin(), word.end(), c), word.end());
    char min;
    min = word[0];
    len = word.length();
    for (i=0; i<len; i++)
    {
        if (word[i] < min)
            min = word[i];
    }
    cout << min << endl;
}