Frequency

AtCoder
IDabc338_b
Time2000ms
Memory256MB
Difficulty
You are given a string $S$ consisting of lowercase English letters. Find the character that appears most frequently in $S$. If multiple such characters exist, report the one that comes earliest in alphabetical order. ## Constraints * $1 \leq |S| \leq 1000$ ($|S|$ is the length of the string $S$.) * Each character in $S$ is a lowercase English letter. ## Input The input is given from Standard Input in the following format: $S$ [samples]
Samples
Input #1
frequency
Output #1
e

In `frequency`, the letter `e` appears twice, which is more than any other character, so you should print `e`.
Input #2
atcoder
Output #2
a

In `atcoder`, each of the letters `a`, `t`, `c`, `o`, `d`, `e`, and `r` appears once, so you should print the earliest in alphabetical order, which is `a`.
Input #3
pseudopseudohypoparathyroidism
Output #3
o
API Response (JSON)
{
  "problem": {
    "name": "Frequency",
    "description": {
      "content": "You are given a string $S$ consisting of lowercase English letters. Find the character that appears most frequently in $S$. If multiple such characters exist, report the one that comes earliest in alp",
      "description_type": "Markdown"
    },
    "platform": "AtCoder",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "abc338_b"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "You are given a string $S$ consisting of lowercase English letters. Find the character that appears most frequently in $S$. If multiple such characters exist, report the one that comes earliest in alp...",
      "is_translate": false,
      "language": "English"
    }
  ]
}
Full JSON Raw Segments