+ 2

Memory error and longer time to execute program

When I input letters (2-5) it takes less time, 7 letters takes around 57 seconds, don't have the patience to know how long 8-11 will take, but 12 upward, I'm getting memory error https://code.sololearn.com/c8vN4BI6EU56/?ref=app

14th Dec 2018, 8:18 PM
Joseph Ojo
Joseph Ojo - avatar
6 Answers
+ 7
Your speed troubles can be lessen if you use a set instead of a list to check if your words exist (your "merged" list). Lines 28 and 53.
18th Dec 2018, 2:20 AM
CĂ©pagrave
CĂ©pagrave - avatar
+ 5
You can use my github hosted word list if you want 😊 https://code.sololearn.com/cYWZw368gHYG/?ref=app
18th Dec 2018, 2:17 AM
CĂ©pagrave
CĂ©pagrave - avatar
+ 3
CĂ©pagrave changing the list to set worked , 7 letters doesn't take 57 seconds , it's not even up to 2 secs , tho anything more than 10 letters still spring memory error...thanks to everyone
18th Dec 2018, 4:13 PM
Joseph Ojo
Joseph Ojo - avatar
+ 2
There is a CPU limit on SoloLearn Playground. Programs that hit it always get errors usually timelimit exceeded, but others are possible. The interaction between the app and the remote server running your code isn't perfect so even programs that do work correctly display memory error messages occasionally.
14th Dec 2018, 11:05 PM
John Wells
John Wells - avatar
+ 1
A suggestion...to run here, that program needs a wordlist file. ~ Can you create a small wordlist as part of the program's startup, then read it in normally? You won't be able to run very large scans here, but your problem appears to be exponential so even a few characters' range ought to be useful. ~ Some of us may be able to read the code for things like exploding permutations, but making it work here helps us practice connecting / testing what we think it's doing with what's happening :)
15th Dec 2018, 3:50 AM
Kirk Schafer
Kirk Schafer - avatar
+ 1
Here's a code that imports its wordlist from a public repository, FYI: https://code.sololearn.com/cUTx0iILpRhn/?ref=app
17th Dec 2018, 5:45 PM
Kirk Schafer
Kirk Schafer - avatar