Company: Publicis_sapient_22nov
Difficulty: medium
Divisors and Multiples Problem Description Given an array `arr` of length `n`. For each index `i` from 0 to `n-1`, count how many indices `j` (where `j` is not equal to `i`) satisfy either of the following conditions: * `arr[j]` is a divisor of `arr[i]` * `arr[j]` is a multiple of `arr[i]` Definitions: * `x` is a divisor of `y` if `y` is divisible by `x` (`y % x == 0`). * `x` is a multiple of `y` if `x` is divisible by `y` (`x % y == 0`). Return an array where the `i`th element represents the count for the `i`th element of the input array. Complete the function `getCount` in the editor with the following parameter(s): * `int arr[n]`: an array of integers **Returns:** * `int[n]`: the answers at each index Examples Example 1: Input: `arr = [1, 3, 4, 2, 6]` Detailed breakdown: i: 0, arr[i]: 1, Divisors: 0, Multiples: 4, Count: 0+4=4 i: 1, arr[i]: 3, Divisors: 1 (from 1), Multiples: 1 (from 6), Count: 1+1=2 i: 2, arr[i]: 4, Divisors: 2 (from 1, 2), Multiples: 0, Count: 2+0=2 i: 3, arr[i]: