Time Limit Exceeded on 13 lines? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Time Limit Exceeded on 13 lines?

https://code.sololearn.com/c0QwT53pOkEA/?ref=app I'm trying to make this work, its from my Java courses. I ran into that issue and googled it to find its a common error for code thats too long and hard to compile by the server. Thing is, this code has less than 15 lines. Would greatly appreciate some help!

20th Apr 2017, 2:13 AM
Cristian Dutrus
Cristian Dutrus - avatar
5 Answers
+ 8
This is a common error for code thats too long and hard to compile OR to execute ^^ Your code seems to call 'JOptionPane' object through the method showInputDialog() which I suspect to be a GUI ( graphic user interface ) one for user input, and codeplayground is limited to the 'Scanner' object ( CLI -- command line interface -- input ), only by inputing all user entry at once just before real run of the code...
20th Apr 2017, 2:22 AM
visph
visph - avatar
+ 4
Your trying to display the result in a separate window ..but I don't think this works in codeplay ground :0
20th Apr 2017, 2:19 AM
Manideep
Manideep - avatar
+ 2
joptionpane doesnt work here
20th Apr 2017, 2:22 AM
Edward
+ 1
yes, i agree with @shikamaru.. Is coding playground which is making it not possible to run.
20th Apr 2017, 2:23 AM
Welliton Malta
Welliton Malta - avatar
0
Thank you all for the quick response! May I ask, is there any alternative that supports similar code in android? My laptops currently being repaired and I need something to work with in the meantime.
20th Apr 2017, 2:44 AM
Cristian Dutrus
Cristian Dutrus - avatar