I am getting wrong answer help!

My code–https://ide.codingblocks.com/s/333863


This is not ongoing any company test

Hey @Bhawna
Your logic is correct but since a[i] can be 10 and N can be 10^5
So u cant save prefix multiplication array
See each num is 1<=10
so you can pre compute the prime factors till ith index of the array.
You only have to keep count of no of 2’s,3’s,5’7 and 7’s

Also no of divisors of X in this case will be =(a+1)(b+1)(c+1)*(d+1) where a is no of 2’s ,b=no of 3’s,c=no of 5’s and d=no of 7’s in its prime factorisation

For eg 6!=(2^4)(3^2)5
So divisors=(4+1)
(2+1)
(1+1)*(1+0)=30

I didn’t get this…
We cannot allocate array of size 10^6??

Hey @Bhawna
You can allocate an array of that size but assume all the elements are 10 in it
so when u create prefix product array then you can’t store
10*10*10… =10^(10^5) in it

Check this , to understand better https://ide.codingblocks.com/s/334039

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.