int electionsWinners(int[] votes, int k) {
    int max = 0, n = 0;
    for(int v:votes)
        if(v > max){
            max = v;
            n = 1;
        }
        else if(max == v)
            n++;
            
    if(k == 0 && n == 1)    
        return 1;
    else
        n = 0;
    for(int v:votes)
        if(v + k > max)
            n++;
    return n;
}
