plduhoux
2/24/2018 - 3:13 AM

divisorsPairs

int divisorsPairs(int[] s) {
    Arrays.sort(s);
    if (s.length == 1) return 0;
    int nb = 0;
    for (int i = 0; i < s.length; i++) {
        for (int j = i + 1; j < s.length; j++) {
            if (s[j] % s[i] == 0) nb++;
        }
    }
    return nb;
}