Sorry but even though this seems to pass the tests, the attempt looks wrong to me.
Let's say the the hero has 5 bullets and 2 dragons to fight. This solutions returns 'false' then, even though the hero has enough bullets (he only needs four).
Maybe I'm overlooking something here, but it misses the point of the instruction and doesn't do what is asked for.
There seems to be a problem with the final tests in Rust (spelling?):
Interesting, I just stumbled upon the same problem with my solution in Rust.
That won't happen, since
1 <= month <= 12
(see description)Would you mind to elaborate? It's almost the same solution in C.
Why would .to_i be necessary? The array consists of integers only.
Sorry but even though this seems to pass the tests, the attempt looks wrong to me.
Let's say the the hero has 5 bullets and 2 dragons to fight. This solutions returns 'false' then, even though the hero has enough bullets (he only needs four).
Maybe I'm overlooking something here, but it misses the point of the instruction and doesn't do what is asked for.
Nice! I think you could even omit "return".
This is just beautiful to look at. My personal favourite!