Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Thank you very much for the hint. The downvoting is my misoperation in fact, sorry about it. Finnally fixed the issue haha.
In the Python solution, I keep getting a timeout, saying my code takes over 12 seconds to complete.
Now, my code may not be optimal, but on my run-of-the-mill desktop machine, even the code sample at https://pastebin.com/SaU5Jfcv (mentioned in the comment from Naiten) completes in under a second.
Ah, thanks for explaining.
Asking for help and downvoting my comment at the same time...? Weirdest thing of the day, I bet...
It's 2 kyu, I won't give you the answer straight away (especially considering that it's a really basic knowledge that you seem to be missing)
Thanks a lot for your reply and help. I googled a lot and cannot find a way to build such a huge string in memory to return. I tried ByteArrayInputStream and FileInputStream and FileOutputStream. Could you please give me a hint on what class or api I could use to solve the issue? Thank you very much.
Oh my gosh, it finally passed... .O.
This comment is hidden because it contains spoiler information about the solution
ok:
EDIT: yep, correcting these stuff, your solution passes the tests. Think about "fundamentals" ;)
There are dedicated tools/objects in Java for this type of stuff, just use them. ;)
In performace test, there is a test input string which length is 18 000 000. and the output string's length is 164 000 000. In java, trying to build a string with a length of 164 000 000 will cause out of memory since the return type of test method is string. Thanks for any advice to pass the test? Thank you!