You should look into Array.reduce
in the third test case, -1 is not only, array has three -1
result shouldn't be defined as 0 incase there was a 0 in the array
Is it possible at this point to remove one of the Haskell translations?
I will try fix it but my actually code can't go under 12000ms.
There're solutions using the same approach as you. Either something's wrong with your code, or you get "unlucky" cases with high array length too often to pass.
This comment is hidden because it contains spoiler information about the solution
Java translation - Please Review & Approve :)
Groovy translation kumited. Please review and approve. Thanks, suic
Haskell : https://www.codewars.com/kumite/5bd294549138e38ef6000063?sel=5bd294549138e38ef6000063
Good one! Thanks for making it!
Please, review and approve/comment