Please subscribe to the official Codeforces channel in Telegram via the link https://t.me/codeforces_official. ×

Comments

I use SA to solve this problem which it's a random algorithm.

CODE:https://atcoder.jp/contests/abc151/submissions/9474015

get a string. sort the string. make the string into map<string,int> You can see my code: https://atcoder.jp/contests/abc137/submissions/6811374

This is because my code turned into 1 and 4, and this causes error to my code

This testdata is better than others, my submission code can accept 2 2020, 6 2024. But cannot accept this data.
MY CODE ON ATCODER