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 will, thanks for profesional review ;)
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 translationsOk, done, a little bit adjusted random parameter due to if you have small length of string, than there is a large possibility that many unit tests will end up with result 0. As validated it's looks better, but it's up to you. You are right that my string generation was lazy. Thanks for snippet
the 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 usefuldone, thx for docs
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
This comment is hidden because it contains spoiler information about the solution
This helped a lot. Thanks. Haha
Approved by someone
TypeError: 'int' object is not iterable ???
Ruby translation
I brute forced it
exactly like yours... (but what is even N, in there??)
meh, O(n^2)
Loading more items...