Count of divisors for multiple queries

Given an array of integers A, find and return the count of divisors of each element of the array.

Note: Order of the resultant array should be same as the input array.



Input Format

The only argument given is the integer array A.

Output Format

Return the count of divisors of each element of the array in the form of an array.

Constraints

1 <= length of the array <= 100000
1 <= A[i] <= 10^6

For Example

Input 1:
    A = [2, 3, 4, 5]
Output 1:
    [2, 2, 3, 2]

Input 2:
    A = [10, 20]
Output 2:
    [4, 6]
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a doubt? Checkout Sample Codes for more details.
Start solving Count of divisors for multiple queries on Interview Code Editor
Sign Up
to access hints and editorial solutions for Count of divisors for multiple queries

Discussion


Loading...
Click here to start solving coding interview questions