at time 6:00, why are we using the same while loop "while(m%p == 0) " ?
One syntax doubts
at 7:00, why are we using the if condition ( if(m!=1) factors.push_back(m)) ?
hello @chandreshmaurya
we are iteratrating till square root m so we will cover all prime factor less than square root m.
but there can be almost one prime nmber greater than sqaure root m. so if after complete iteration m is not one that means it is the prime number which is greater than square of m and hence we are pushing it in vector.
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.