In my code the output is coming "Time limit exceeded" how can I make it more efficient | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

In my code the output is coming "Time limit exceeded" how can I make it more efficient

code for finding if the number is prime,if it's reverse is prime & if all the digits are prime ā¬‡ļøā¬‡ļøcode linkā¬‡ļøā¬‡ļø https://code.sololearn.com/cUX4IyPjluIt/?ref=app

27th May 2019, 7:02 AM
Prayas_sinha123
2 Respostas
+ 1
thanks its runin' perfectly
27th May 2019, 7:30 AM
Prayas_sinha123
0
inside rev function check the statement for(;a > 0;) it's infinite loop -- ====================== Make it as follow : int rev(int a){ int g; while(a != 0) { g = g*10 + (a%10); a /= 10; } return g; }
27th May 2019, 7:26 AM
Prokopios Poulimenos
Prokopios Poulimenos - avatar