So I just solved the Roman Numeral Converter Challenge but my code comes across as not super clean and I’m curious to see how other people solved the challenge and if they were able to do it more efficiently than me. Here is my code:

Yours looks similar to mine (although mine no longer solves the challenge since they changed it–i should probably refactor it) I don’t remember who’s it was, but I saw someone who had put the roman characters in a 1D array and used a simple math expression to assemble the Roman numerals from the Arabic. it was super elegant.

Interesting to see an approach that allows you to hardcode less of the transitions. My solution is a lot shorter because I hardcode all the edges. (inspired by a conversation I had with another camper, I wasn’t clever enough to think this up alone).

Yea it’s awesome to see all of these different methods that I never would have thought about. I definitely want to do this with some of the other challenges in the future. Always helpful to look at how others solved a problem and compare it to your own solution.

Hello guys. I just did mine and I was excited to see once again it is different than all the other varied approaches. I do not know enough to know which is more efficient or not, I guess the less code you have the better it is in which case it is not the best, but it works!

Yeah, it’s great to see just how many approaches there are to solving the same problem! You can do this on CodeWars. When you solve a problem, you can see how everyone else did it and you get to see some really elegant solutions. I highly recommend it just for that.

Not knowing my way around the Roman numeral system very well, I went for an approach that was heavy on hard coding. “Elegant” solutions will use more processor power while hard coded solutions will use more memory. However, any reasonable solution for this is not going to tax the processor or memory of a modern desktop or laptop.

It seems that this challenge’s test conditions since I originally finished it last year, so my solution no longer worked. I made a new one for fun and profit. There are some really awesome solutions here!