Submit | All submissions | Best solutions | Back to list |
MAY99_E1 - Letter Count |
In this problem, you will be given a string of less than 1000 characters. The string will contain uppercase and lowercase letters.
Your task is to print the character appearing with maximum frequency. If there are more than 1 such character, print the one with lower ASCII value
Consider lowercase letters as different from uppercase letters, i.e. 'a' is different from 'A'.
Input
Single line containing the string
Output
The character occurring most number of times in the string.
Example
Input 1: abcdabcdaaaa Output 1: a
Input 2: abcAbcAbcabc Output 2: b
Input 3: aDDa Output 3: D
Added by: | Mayank Tuteja |
Date: | 2013-01-17 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | ASM32-GCC MAWK BC C-CLANG C NCSHARP C++ 4.3.2 CPP CPP14 CPP14-CLANG COBOL COFFEE D-CLANG D-DMD DART ELIXIR FANTOM FORTH GOSU GRV JAVA JS-MONKEY JULIA KTLN NIM OBJC OBJC-CLANG OCT PICO PROLOG PYPY PYPY3 R RACKET RUST CHICKEN SQLITE SWIFT UNLAMBDA VB.NET |
hide comments