Count the divisors or multiples present in the Array for each element

                                        function max_element(A, N) {            let MAX = Number.MIN_VALUE;            for (let i = 0; i < A.length; i++) {                if (A[i] > MAX) {                    MAX = A[i];                }            }            return MAX;        }        function countIndex(A, N) {                        let MAX = max_element(A, A + N);                                    let freq = new Array(MAX + 1).fill(0);            for (let i = 0; i < N; i++)                freq[A[i]]++;                                    let res = new Array(MAX + 1).fill(0);            for (let i = 1; i