Memory Exceeded Error | SoloLearn: Learn to code for FREE!

+9

Memory Exceeded Error

why do I keep getting the memory exceeded error when I input a number greater than 22 in this code https://code.sololearn.com/cHHleG5dUBoM/?ref=app

8/26/2017 4:18:48 PM

David Akhihiero

5 Answers

New Answer

+8

hmm will try wit stringbuilders

+8

tried stringbuilders it didnt work

+7

you have a limited memory, time on sololearn if your program goes above that you get the error memory exceeded, time limit exceeded. https://www.sololearn.com/discuss/649687/?ref=app

+7

it's just that similar codes lyk mine run smoothly where mine fail

+3

Try using StringBuilder instead of Strings. The concatenation is likely what's causing the high memory usage. Or try improving the algorithm! 😜 For example, You probably don't need Strings for converting to Oct or Bin