A string S is given on one line from standard input. Output, on one line, the character that appears most frequently in S.
If there are multiple characters with the highest frequency, output the one that comes earliest in alphabetical order. For example, in abc, every character appears once, so the answer is a.
Constraints
1 ≤ length of S ≤ 100 (S consists only of lowercase letters)
Input example 1
aabbbccOutput example 1
bInput example 2
abcOutput example 2
aWhat you'll train
Cover the edge cases
What you get
How to ask the AI
Clearly tell the AI the priority rule for when there are multiple characters with the highest frequency: choose the one that comes earliest in alphabetical order.
If you ask vaguelyWhen there are multiple most-frequent characters, the AI might select based on some other criterion, such as order of appearance.
あなたのコード
プレビュー
AIレビュー(プロンプト練習)
コードはChatGPTやClaudeに出させたものを貼って構いません。
ここでの本番は「次にAIへ出す指示」です。評価軸は1つだけ見て、弱点・指示の穴・改善例を返します。
テストに落ちていてもレビューできます。落ちた理由と、指示に足りなかった情報を結びつけます。