ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 1723. Sandro's Book

Here is simple answer
Posted by Bakhodir Boydedaev 3 Sep 2017 15:13
public static char solve(String s){
        int a[] = new int[200];
        for (int i = 0; i < s.length(); i++) {
            a[s.charAt(i)] ++;
        }

        int index = -1;
        int max = Integer.MIN_VALUE;
        for (int i = 0; i < a.length; i++) {
            if (a[i] > max) {
                index = i;
                max = a[i];
            }
        }
        return (char)(index);
    }