What you've asked is a good question. I don't have an answer to that. I chose to solve the question as proposed before your answer because it requires a bit more from the coder, in this case, me.
Thanks for updating stale translations. I've approved a downstream fork.
For future reference: unless the reference solution is wrong/buggy or not performant enough, there's no reason to change it with your own in a fork; when the translation is approved, the solution (with your changes!) will show up under the original author's name, not yours. I'm sure you'll understand why it's undesirable to publish code in someone else's name.
A bit of a nitpick, but fair enough: since this is a beginner kata, best to start teaching good habits. That said, there were other things wrong with this translation so I took the liberty to fix those too.
What you've asked is a good question. I don't have an answer to that. I chose to solve the question as proposed before your answer because it requires a bit more from the coder, in this case, me.
Thanks, I'm really not very good at Rust as you can probably tell.
Seems like the more readable the code gets, the worse it performs.
It's probably because of all the references and function calls.
Thanks for updating stale translations. I've approved a downstream fork.
For future reference: unless the reference solution is wrong/buggy or not performant enough, there's no reason to change it with your own in a fork; when the translation is approved, the solution (with your changes!) will show up under the original author's name, not yours. I'm sure you'll understand why it's undesirable to publish code in someone else's name.
Yeah, probably. I remember wondering about that when I wrote it. Then the tests all came back green and I forgot about it and moved on.
Fixed, along with other improvements.
A bit of a nitpick, but fair enough: since this is a beginner kata, best to start teaching good habits. That said, there were other things wrong with this translation so I took the liberty to fix those too.
I prefer two spaces, but since Rust and the Codewars Rust editor appear to be rather strict about it, I changed it to four spaces.
Thank you, I think I fixed it now. The random tests import the HashMap themselves.