Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
You can refer to the Rust translation in the Authoring examples.
I have the same strategy as you do. I'm 41 katas left to finish every 8kyu. Good to see another crazy person here, haha.
Seems like the more readable the code gets, the worse it performs.
It's probably because of all the references and function calls.
lol. I've checked on godbolt and we've been getting less and less efficient (at least in terms of assembly length). My initial solution was 186 lines, then 247, and yours is 504. It's not an actual speed comparison, but assuming it's a similar effect, that would show an inverse relation to legibility.
Yours is definitely the most legible, whereas my initial minimizes the number of passes.
geez, so smart
This comment is hidden because it contains spoiler information about the solution
This is my first attempt at translating a kata, so feel free to tell me if I'm doing anything wrong.
Someone needs to be hired.
I wish I could understand what is going on. But I still love it.
check out the fork. i improved the number writing algorithm :)
I must say, that after solving almost every single 8kyu Kata (I have like 35 left). This is definitely the worst one.
Oh, I see. Yes, my mistake, I just realized that.
Holy Mother of God, this is the code we have not deserved.
Please don't raise a kata
Issue
when you're simply asking aQuestion
. See https://docs.codewars.com/training/troubleshooting/#post-discourse.Your second solution completely ignores the elements of the input, so it's obviously incorrect. It does pass the sample tests and fixed tests though, this is because there's only one test case in both, and its expected output happens to match what your second solution outputs.
This comment is hidden because it contains spoiler information about the solution