Primes Factors ambiguity

In video, its shown that prime factors of 12 are 2,3.

But, actually primes factors of 12 are 2,2,3. Isnt it ?

So, do we include duplicate factors or we exclude them (2 in this case).

@anuj_it we are only finding the distinct prime factors of a number.
If this resolves your doubt mark it as resolved.

Plz let me know what is its time complexity. I am not able to get it.
Video code link

@anuj_it hey you forgot to save the code. But if you are asking about the complexity of code in video, then it is O(nloglogn) and for factorization worst it can be O(sizeof_prime_array).
Overall complexity will be O(nloglogn)
Now how nloglogn comes.
First loop will run(a bit of approximation) in n/2, second in n/3, third in n/5 so on (loop runs for prime numbers only, this can be seen from code as we check if th number is marked of not)
take n common, we have sum of reciprocals of prime(1/2 + 1/3 + 1/5 + 1/7…) so on now this prime series has sum loglogn (requires calculus to be calculated you should not worry about that) so we have nloglogn
If this resolves your doubt mark it as resolved.

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.