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.
C++ version. Contrary to the description, negative arguments are fed to the function.
The expected results for negative fractions look strange:
Incorrect result for fractionToPeriodic(-1689246217, 36291): Expected: equal to "-46547.(-2-4-90-9-7-5-7-2-400-...)"
Suddenly it looks so simple.
Should it be mentioned that the function is pure or am I missing something?
I get a SIGABRT with my code. Surely, my code is wrong but I do not allocate any memory so how is it possible?
Besides, I'm seeing
Expected: "*&ikh)ihg&j'kj%&hij'-&'*ih)h'"
which should not be possible ("Every String consists of only lowercase letters and spaces.")
Using the very big hammer, nice.
Ruby version: For "" (empty string) the expected return is false although all gs are happy. Is that correct?
It's always good to have a π along ;-)
indeed
Thanks, that was fast.
Haskell version
The code template says "balanced :: [Bool] -> Bool" but the required type is
"balanced :: [Word] -> Bool".
Also it is unclear why tube sizes are passed if they are all the same (or 0).
This also groups repeated digits in the integral part.
repeating_fractions(221, 1) => "(2)1.0"
The regexp should probably be /(\d)(\1+)(?!..)/.
Finally a solution in O(n).
Ruby version: Had to
require 'set'
in order to make the test framework work.That's disappointing indeed. The fitness
Proc
expects an integer rather than a binary string. Call it withfitness.call(c.to_i(2))
.This can generate a small subset of the valid strings only.
Loading more items...