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.
added to CoffeeScript, Ruby
hello, sadly MSVC does not yet support variably-modified types. the
n
inside brackets is purely advisory here though, you can delete it so that MSVC accepts it: the parameter is equivalent toconst char* const names[]
fixed
approved
one last thing: when using mutable types such as
String
, you must either pass a copy to the user (test.dup
) or call the reference solution before the user function. otherwise the user can change the object to cheat. i fixed it myself this time, but remember it if you write other translationsthe random strings generation is a bit lazy. you rely on their large length to make sure that there will be some duplicates --> large inputs should only be used in performance katas, they make it hard to debug one's code. what you could do instead is to generate a string from its character counts, e.g.
that way, strings will be short enough to be put inside the
it
message, instead of their length that is currently there and not very usefuladded
i already told you why below, you replace the newline characters for no reason , the description does not ask for this
Despite its name, the C standard does not mandate that implementations of
qsort()
use the quicksort algorithm. In fact, it does not even require aO(n log n)
complexity forqsort()
, though of course most clibs will make it as fast as possible because it is an important function. So you cannoy rely on its stability.That being said, it seems like the glibc standard library (the one used on Codewars, which runs on Linux) uses mergesort in most cases; and "most merge sort implementations produce a stable sort". Do not rely on it though, it is an implementation detail. If you need a stable sort, make it stable yourself, e.g. by comparing the pointers themselves in case of structural equality.
test_ans
should be made inaccessible to the user, e.g. by making it a proc or a lambda:https://docs.codewars.com/languages/ruby/authoring#reference-solution
(to be more precise: the initial code in TypeScript does not compile)
didnt realize i had editing rights, done
in JavaScript, assertio messages are truncated;
chai.config.truncateThreshold
should be set to0
why do you replace the newlines ? the description does not ask this
duplicate of this issue
Loading more items...