I'm sorry, I can't get what you mean. What do you mean by "blocked"?
Ruby 3.0 should be enabled.
sometimes things are simpler than they seem
how to handle exception when array is [1, 2, 4, 5, 5]
A good light kata.
Added more tests (a set of random ones). I hope @jdwolford be ok with it. Sorry if I overstepped here, the number of js solutions was reaching the point where the tests become blocked.
This comment is hidden because it contains spoiler information about the solution
R translation kumited.
Please carefully review and approve!
Comments included to help you grok R, if you're not familiar with it. Basic and example tests taken directly from python version. Random tests use the same parameters, but a slightly different structure.
As others have pointed out. There is no guidence on what should be returned if the input is invalid. -1 maybe? Would have made the Kata more interesting.
If there is no guidance or it doesn't test for it, why even mention it.
The description should be clearer about invalid input. Is it, that we can expect only ever to get valid input, or should we somehow react on an invalid input array? From my passing the tests without dealing with invalid input, I would expect the former. Only the instructions should say so.