Skip to content · ⁨본문 바로가기⁩

Most frequent character · ⁨가장 빈번한 문자⁩

English

Most frequent character

Return the character that appears most often in a non-empty String. If two characters tie, return the one that appears earliest. A simple approach: for each character, count how many times it occurs, and keep the best so far — using a strict > so a tie keeps the earlier character.

한국어

가장 빈번한 문자

비어 있지 않은 String에서 가장 많이 등장하는 문자를 반환합니다. 두 문자의 등수가 있을 경우, 가장 먼저 등장한 것을 반환합니다. 간단한 접근법: 각 문자에 대해 발생 횟수를 세고, 현재까지 최상의 결과를 유지합니다 — 엄격한 >을 사용하여 등수 시 이전 문자가 유지되도록 합니다.

Log in or create account · ⁨로그인 또는 계정 만들기⁩

IGCSE, A-Level & AP