Each time when I run submit tests I get random test failures but when I try to run the same test in test playground it works for me. And the pressKeyCount in the failed test could be different, it includes a small number and number greater than 88
-> GO lang
The sample tests are expecting the function to be named encrypt rather than initials.
So iteresting kata, but from not native english warrior description is very difficult . At first, i can't understand how key will be pressed after 88: 1st or 88th, 87th and e.t.c.
It's just the shorthand if-else notation known as conditional expressions (aka ternary operator).
How it possible?
oh i didn't know this was possible
I like this!
This comment is hidden because it contains spoiler information about the solution
I have some questions about your code. If the spin is ["Star","Wild","Wild"], your function will return 18 but the right result should be 10.
I have fixed this issue and republished the Ruby translation.
I just tried your code in a fork and never had any problems, though... :o (apart from the fact that I don't know how you did submit this version since it doesn't compile (unsafe opeartion because you didn't decalre the type the list is holding) x)
I havent troubles - my solution accidentally passed tests.
ty for "abs" remark. Squaring gives positive result anyway.
my result 9.055385138137417
in example 9.05538513814
my result 10.295630140987
I should have been more careful. Sorry.
java: the same computation is used, though (except for the abs). Check for another source of troubles?