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.
I think your problem was with using
array_unique
I guess internally it makes a copy of the array and that was what's exhausting the memory.I created a second array with unique values.
I found a solution without creating a unique array and now they all pass. Thx for the tip.
Click reset a few times and try again. If it still doesn't work, paste your code and mark your post as having spoiler content. Are you by any chance creating a new array?
I'm still getting this error when running my solution:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 67108872 bytes) in /home/codewarrior/run.php on line 6
I only get this on the last testAdvanced so i guess my solution works but the test array must be to big.
@GlennVL91 try again now.
I think I've solved it now, reduced the length of the array (it was exhausting the available memory without reaching a timeout). I've added a test about processing time for the Advanced tests part, and if your code runs for more than 500ms it'll fail.
Yes, it seems a test array is so big that even O(n) solutions won't pass now.
Your solution is not performant enough, but the random tests are broken right now, one test won't pass even O(n) algorithms.
I have different PHP solutions for this issue but on the last test i get a memory issue because of the large test data.
Somebody had the same problem and can help me towards the right solution?