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.
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.
Fails or 515377520732011331036461129765621272702107522000 (3**100 - 1).
fails for n = 99999999999999999
Oh no. I misread the sentence as "... do not count ..." Stupid me. Sorry for the noise.
Haskell version. There are no test cases for the requirement:
"hyphens/dashes ("-") for negative numbers do count towards the length"
As far as I can see, all solutions including my own fail that.
Loading more items...