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 stand corrected
This does not account for the case when both letters are upper and should return 1.
True, I don't remember why I didn't do that
I explained why they are not properly implemented: "The way it currently works is that it fails and you can't tell which test failed."
Do you need more than 1 person to tell you something is wrong to fix it - even though that is obviously so?
From my PoV it is an issue because the tests are not properly implemented. But if that is part of the difficulty - it is ok. Would be better to mention that in the description. But not mentioning it can also be considered as part of the increased difficulty.
Yep, that was it. Funny issue with how going out of bounds does not throw errors but wraps around.
This might be related to the issue I am having:
λ> (2 :: Int) ^ 60
1152921504606846976
λ> (2 :: Int) ^ 61
2305843009213693952
λ> (2 :: Int) ^ 62
4611686018427387904
λ> (2 :: Int) ^ 63
-9223372036854775808
I'd say Int being 64 bits would be a good explanation based on maxBound - so not an issue then.
Although no idea why my solution passes so many of the first tests and fails on this big number ones though (which just happens to be close to the 64 bit boundary).
The way it currently works is that it fails and you can't tell which test failed.
You can keep it this way, but it is just added extra-difficulty - your choice.
I logged the arguments of the function and
timeLimit
is passed at one point with a value of7504329699704653555
and that will not fit in an Int which is Int32.At least the 2nd argument of the function should be changed to Integer instead of Int eg.
alexMistakes :: Int -> Integer -> Int
alexMistakes numberOfKatas timeLimit = ...
timeLimit is of type Int and Int in Haskell is Int on 32 bits, so everything over about 4 000 000 000 can not be stored in it
and 8337374094012673832 is not storable in Int32, probably Int64, which would require type Integer for example which is unbounded in Haskell
still looking into it, in case I am misunderstanding this - could be some internal computation that goes over Int and is not needed to be Int internally
Cheers
This comment is hidden because it contains spoiler information about the solution
Haskell signature should be
fourPiles :: Int -> Int -> [Int]
instead of:
fourPiles :: Int -> Int -> Int
Some of the installed packages: https://github.com/Codewars/codewars-runner-cli/blob/master/docker/haskell.docker#L32-L35
Loading more items...