kotlin-coding-challenges

Max occurring char

Instructions

Given a string implement a function which returns the character that is most commonly used in that string.

Challenge Solution

Examples

maxOccurringChar("abcccccccd") // "c"

maxOccurringChar("apple 1231111") // "1"

Hints

Hint 1 Use frequency counter or multiple pointers pattern.