If you used a loop {} construct instead of the for loop, you wouldn't need the unreachable (0, 0, false) case, since a loop {} that never terminates has the never type (!) which Rust can automatically coerce to any other type.
I'm having the exact same problem, my solution does work with 1 tho, my solution fails for the second test case, it just says "Value is not what was expected".
From a Python interpreter session with my solution:
can you explain your solution please?
Did it similar) Nice. I heard bit operations is faster)
I believe this is literally what the Kata's instructions are asking for
Spoiler flag!
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
If you used a
loop {}
construct instead of the for loop, you wouldn't need the unreachable(0, 0, false)
case, since aloop {}
that never terminates has the never type (!
) which Rust can automatically coerce to any other type.nice!
It's been fixed already.
console.log('anything') on line #1
for some reason that worked for me.
Yeah I'm having this same error, I wonder if it has to do with my solution.
Having the same problem!
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
I'm having the exact same problem, my solution does work with 1 tho, my solution fails for the second test case, it just says "Value is not what was expected".
From a Python interpreter session with my solution:
I don't see anything wrong with this.
Loading more items...