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.
If the type system will handle it, you can always write your
let rec
expressions in lambda syntax. If I can do it in LC, you can do it in Ocaml.See https://en.wikipedia.org/wiki/Let_expression for how to rewrite
let rec
, and ping me on Discord ( in#lambda-calculus
) for how to do mutual recursion andY*
.Note that I can't help you with the type system, and I know from Haskell recursive types can be a hassle. I might be able to do the type in Haskell, if that will help you do it in Ocaml ( it really helps here that LC is untyped ).
in c++ error test:
Expected: equal to [unsupported type]
Actual: [unsupported type]
OK - figured out the problem.
Although the show representation was identical, my internal representation of polynomials was ambiguous.
To fix this I needed to implement Eq.
In the field multiplication test I got the result:
Expected x^6 + x^5 + x^4 + x^3 + x^1 + x^0 but got x^6 + x^5 + x^4 + x^3 + x^1 + x^0
I can't see any difference here. What's the problem?
Done, thanks!
For the Java version it would be a nicer experience if the intitial code could at least compile such that all method stubs are filles with
return null
.Спасибо, очень доступное объяснение в ролике, все понятно даже не смотря на мой слабый английский
Okay this :
Note: Frequency lists with just one or less elements should get rejected. (Because then there is no information we could encode, but the length.).
is missleading, just return the frequency list no matter it's size. Retuning null if freqs.length<=1 cause error in the tests
I keep getting this error :
I get that input validations is necessary and all, but I spent more time wondering why would one pass an empty list to encode (I am fine with empty strings) than finding errors in my code. Great kata nevertheless. I would suggest imporoving the functions signatures to remove some redundency in the computations but maybe it is me who wasn't clever enough (though I could ignore some variables but that annoys me even more). Again, great kata.
The
let rec
construct has some limitations, for example it is not possible to define the list of naturals like so :The precise explanation of what is or is not acceptable as a right hand side is available in the OCaml manual.
This comment is hidden because it contains spoiler information about the solution
It is meant to be a puzzle. If I provide the algorithm, then what is the challenge? You have to figure out how to reconstruct the shifts by yourselfs. Obviously, you can also google it.
Good kata but I found decoding instrution not intuitive, in my opinion it should be extended.
Current simple explanation is not sufficient and if someone doesn't know the IBWT then it will be hard to proceed based only on description from excercise.
This solution was meant to expose the lazy testing of this kata. My actual solution is here: https://www.codewars.com/kata/reviews/54e4b5cfd5e01959820000b5/groups/55e36e2cda32c7934600006e
Loading more items...