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.
Solutions typically do not sanitize or validate inputs unless they are part of the test cases.
This comment is hidden because it contains spoiler information about the solution
Correct– .sort() works inplace. While that reduces memory overhead, that is bad practice for most functions because of Python's implicit pass-by-assignment mechanic. The function would have the side-effect of sorting the original list, which might or might not cause a very difficult to find bug later.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Always load libraries at the beginning of your code. The reason is two-fold: those reading your code know exactly what libraries you are using, and it increases the efficiency of your functions (as the function would have to check if that library was loaded everytime it was called).
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Is it ready to be published?
I converted it to use random and chrono instead.
Edit: Noticed I left a rand. Fixed it.
I moved the reference function to a lambda inside the random test block, and I changed the call order of the solutions. I also changed the srand/time calls to reference the std namespace. I ensured the vector stays between 2 and 50 elements. Does that solve all the problems?
Especially bad since it received best practices instead of clever
C++ Translation :)
https://www.codewars.com/kumite/5d33ab9634d006000e7becf0?sel=5d33ab9634d006000e7becf0
Please approve!
C++ translation kumited :)
https://www.codewars.com/kumite/5d2f5b90bceae8000fd4df2c?sel=5d2f5b90bceae8000fd4df2c
Loading more items...