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.
Multiplying by 0 will still bring num to single digit.
Treat it like any other number.
I have a similar solution. 1 liners are kind of harder to read.
you would think that the count == null would handle it, but for some reason it does not
took me the longest time to figure out the NULL type error. had to look it up
Very new to JavaScript language and had watched some tutorials and wanted to try solving this as a 1 liner... did not work.
I had to look up some things because I was unsure if some built-in methods could be used here but sure enough they can. Very unfortunate because my rabbit hole led me to finding the solution, but a positive takeaway is that I thought about the solution; I just did not know how to code it. I knew what I wanted to do.
Advice: take it step by step. Focus on getting the individual numbers and then decide what condition to check with that number (how many times aswell).
As a suggestion, I recommend added the other cases, in between 1-1000, to the variable you set up to store the roman numeral symbol and its value. (for example, add 4, 9, 40, etc.)
Once I did this, it became a lot easier to code out what I wanted to do so I did not have to have a lot of non-sense code trying to replace symbols.
This comment is hidden because it contains spoiler information about the solution