Some of my codes are working properly in apps like Dcoder but not in the code playground of Sololearn. What did I do wrong? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

Some of my codes are working properly in apps like Dcoder but not in the code playground of Sololearn. What did I do wrong?

This code for emirp primes does not work in the code playground. Error type: doesnt give positive result for true input values. https://code.sololearn.com/c34N8G0FLpxe/?ref=app

11th Oct 2018, 3:09 PM
SilverMiracle
SilverMiracle - avatar
2 Respostas
+ 1
Your major issue is line 27 as a should be initialized to 0. Minor issues: you could replace line 17, 19, and 21 with a 19 of: a = a*10+n%10; and you could remove a from 27, on 30 replace a++ with break, and replace lines 33 to 36 with: return i == n;
11th Oct 2018, 7:48 PM
John Wells
John Wells - avatar
0
John Wells Thank you for your corrections.
12th Oct 2018, 5:19 AM
SilverMiracle
SilverMiracle - avatar