Panda Guru LogoPanda
Guru

Count Number of Subsequence that divides with K

Round 1

Questions: You are given an array a of length n consisting of positive integers, and a number k.

Your task is to find the number of subsequences of 'a' such that the product of the numbers in the subsequence divides k. Since the answer can be large, return it modulo 10^9 + 7.

Input Format:

Constraints:

Sample Test Cases:

Case 1
Input:

3 5 3 7 9

Output:

0

Explanation: Here, n=3, k=5, a=[3,7,9]. There are no valid subsequences where the product of numbers divides k=5. Hence, the answer is 0.

Case 2
Input:

4 4 2 2 2 2

Output:

11
Candidate's Approach

No approach provided.

Interviewer's Feedback

No feedback provided.