Roman Numerals Alogrithm Challenge

Roman Numerals Alogrithm Challenge
0.0 0

#1

I am having a LOT of trouble. I’ve read the first two hints but I really don’t wanna look at the answer. I really don’t understand how this would work. Can someone point me in the right direction?


#2

Think about the steps you would do this manually on paper. Try to break the problem down into smaller pieces and write out an written algorithm of how you would solve each piece. Then it is a matter of putting the pieces back together for a final solution. Don’t try to start coding immediately. Work through an example (such as convert then number 6 to roman numeral) using your written steps first. Try other larger numbers and figure out where there are similarities in the steps you take to arrive at the final correct answer. You will eventually see a pattern you can use for all the roman numerals in the test cases.

Once you finally think you have a written plan of attack, then start thinking about data structures you already know how to use (i.e. arrays, objects, etc…) and how you could use them in your coded solution.

Don’t expect to solve some of these challenges in one sitting. Sometimes you must take a break and come back with a fresh outlook on the problem.

Once you get a written algorithm or some code, feel free to post it here and we can help guide you without giving you the entire solution.