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.
same here. I wrote the 5 lines of code to create a new list, go through the range of n to append value into the new list. :)
I ❤️ PYTHON
Approved
Please review: C++ Translation
Approved
Taking 5s for the performance tests is still really weird, have you tried using arrays instead of lists? In general I'd use them anyway for this task, otherwise you're kind of forcing people towards one particular solution.
Translation has been updated to add smaller correctness tests.
Regarding the performance, the test runner is fairly slow when compiling Haskell solutions, adding between 3 and 6 seconds to the runtime. I did manage to make some micro-optimizations to the reference solution, which saved about 0.5 sec over the entire test suite, but that's hardly significant.
Also, are you sure you didn't mess up the time complexity? It's very sus that you're taking 12s to run the same tests that take python 3s.
Added in Python.
Would you mind changing the random test generation to match the pending OCaml translation, or the current state of Python?
Specifically, adding the section of small correctness tests.
OCaml translation
Performance test specs are significantly buffed compared to Python in order to achieve comparable difficulty, test solves would be appreciated to make sure I didn't over/undercook them.
Should probably have at least a small batch of small random tests, along the lines of
n=20; 3 <= |xs| <= 10.Maybe change name to something like
Summing subarrays without duplicates?Is more clear imo.
Haskell translation
Yes
Loading more items...