checked various times. downloaded test cases. still won’t work
Wrong answer for test case3. inspite being correct
Hey Kuwar,
You are not computing by proper way.
You are calculating all prime numbers bt you dont need here.
For calculating Prime factors.
Following are the steps to find all prime factors.
- While n is divisible by 2, print 2 and divide n by 2.
- After step 1, n must be odd. Now start a loop from i = 3 to square root of n. While i divides n, print i and divide n by i, increment i by 2 and continue.
- If n is greater than 2…then it is also prime number
here, in your code …you are missing 3rd point…
Refer my code
Mark it resolved…if u get it
I understand that my logic is not efficient, but that’s not the problem. my answer for 3rd test case is correct. but still it’s showing wrong.
I downloaded it obviously…
Can u show me test cases buddy.
Definately your code is missing something as it is passing my all correct test case
test case3 is
378
output
1
yeah … your code is working fine for this test case…You must be wrong on some other test case
Tell me your approach in line 31 to 51.
Try to convert int to long in your code everywhere.
all other test cases are correct. and even this is giving the correct answer. there is something wrong with the java compiler. i have had issues before as well.
won’t make a difference. doesn’t exceed the limits
Hi kunwar can u tell the logic between 31 to 51 line
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.