Untitled

mail@pastecode.io avatar
unknown
c_cpp
8 days ago
457 B
10
Indexable
Never
#include <bits/stdc++.h>
using namespace std;
#define ll long long


int main()
{
    int a;
    cin >> a;

    char w[123] = {};


    for (int i = 0; i < a; i++)
    {
        char x;
        cin >> x;
        w[(int)x]++;
    }
    for (int i = 97; i <= 122; i++)
    {

        if (w[i] >= 1)
        {
            while (w[i]--)
            {
                cout << (char)i;
            }
        }
    }
    return 0;
}
Leave a Comment