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.
This comment is hidden because it contains spoiler information about the solution
Fixed.
You're correct, there is no integer base where 2 or 0 is made up of all 1s, and 1 is "all 1s" in every integer base.
Hence, the kata only requires you to return an answer for n >= 3.
Edit: Actually the Python reference solution returns
1
forn = 2
and the random tests technically could test that, lol. You have a point...Yes, your example is invalid code and should throw an error.
A
call
uses the variablevarx
andvarx
has not been defined at the time of the call.I note that this scenario is not actually being tested.
Expurple's example is also invalid, beause there is no
changeA
variable defined.proc
parameters are not global definitions.there is still an issue here. because the lyrics include this single non-ASCII character, the initial code in C should specify that the expected output encoding is UTF-8. i did it in this fork, pending approval.
Can't you copy/paste it from the description?
fixed
Rejected.
Too easily cheatable, and use of
Random
instead ofQuickCheck
.Approved.
This comment is hidden because it contains spoiler information about the solution
I don't remember the exact reason but I do remember that there was a good reason to remove this
.
This comment is hidden because it contains spoiler information about the solution
https://en.wikibooks.org/wiki/Haskell/Fix_and_recursion
Great! One more thing, do I need to worry about the bug caused when 'i' reaches SIZE_MAX and wraps around to the (usually) wrong index?
I've chosen the 'i++ % str.size()' solution as it's the most idiomatic. However, this approach is less problematic in other languages where the max size of integral types is guaranteed to be really large. Considering SIZE_MAX can be as low as 65535, do you think this warrants a revision for the C++ solution? Or is it good enough for a Kata?
Loading more items...