Count of multiples in an Array before every element
Given an array arr of size N, the task is to count the number of indices j (j<i) such that a[i] divides a[j], for all valid indexes i. Examples: Input: arr[] = {8, 1, 28, 4, 2, 6, 7} Output: 0, 1, 0, 2, 3, 0, 1 No of multiples for each element before itself â N(8) = 0 () N(1) = 1 (8) N(28) = 0 ()