It has different performance characteristics. This solution means that you allocate a whole new array just so you can find its length.
In Haskell, it's not a problem because list nodes are only created as needed. There is also short cut optimization to make sure that a solution like this will be efficient.
Unlike others, I feel iffy about this one. This looks like someone adopted Haskell's solution on an imperative programming language, despite Javascript uses arrays and not list.
It has different performance characteristics. This solution means that you allocate a whole new array just so you can find its length.
In Haskell, it's not a problem because list nodes are only created as needed. There is also short cut optimization to make sure that a solution like this will be efficient.
I wish that the input gets simplified, so we get into the core of the problem, which is SAT, instead of also doing parsing too.
Unlike others, I feel iffy about this one. This looks like someone adopted Haskell's solution on an imperative programming language, despite Javascript uses arrays and not list.
The Haskell one has a pretty sus test case. Why is there
Num
instance forString
? Just write the quotes already.This comment is hidden because it contains spoiler information about the solution
This is a math kata, not a programming kata