void preProcess() {
        int maxVote = 0;
        int maxPerson = -1;
        for (int i = 0; i < times.length; i++) {
            int votedTime = times[i];
            int votedPerson = persons[i];
            candidates[votedPerson]++;
            if (candidates[votedPerson] >= maxVote) {
                maxPerson = votedPerson;
                maxVote = candidates[votedPerson];
            }
            votes.put(votedTime, maxPerson);
        }
    }
Why Did you create this class? what does it do?
src/problems/medium/TopVotedCandidate.java