Page 1 of 1

12802 - Gift From the Gods

Posted: Fri Oct 10, 2014 10:48 am
by MPC1984
Hi everybody!!!
I'm getting RTE in this problem, and I don't know why. Somebody could help me?

Here is my code in Java:

Code: Select all

AC
Thanks in advance. :wink:

Re: 12802 - Gift From the Gods

Posted: Sat Oct 11, 2014 2:27 am
by brianfry713
At the end of the input you're getting a java.lang.NullPointerException by calling trim() on a null String.

Re: 12802 - Gift From the Gods

Posted: Sat Oct 11, 2014 11:51 am
by MPC1984
Hi brianfry713!
I have done changes you said me, but now I'm getting WA, what's wrong?

Code: Select all

AC
Thanks in advance again. :wink:

Re: 12802 - Gift From the Gods

Posted: Mon Oct 13, 2014 10:54 pm
by brianfry713
You have to stop the output when the input is a palindrome prime number (after outputting its double also).

You are comparing a StringBuilder to a String, which will always return false.

Re: 12802 - Gift From the Gods

Posted: Tue Oct 14, 2014 12:32 pm
by MPC1984
Thank you brianfry713!!! I got AC.
A very silly mistake comparing a String and a StringBuilder. :D