This code is part of the "Tech Challenge Series – Advent Calendar 2021" advanced by Blip.pt (developed by Devskiller).
This year counting down to Christmas will be even funnier and Blip will be by your side the whole time with a variety of small programming puzzles and lots of prizes!
Santa is trying to deliver all presents in time. He arrives at a street where all doors are numbered using Roman Numbers but all he has are addresses with Arabic Numbers. Can you help him do the correct conversion so all kids get their presents?
Note: The largest number that can be represented in this notation is 3999 (MMMCMXCIX).
Reference: https://en.wikipedia.org/wiki/Roman_numerals
Input example: "DXXI"
Output example: 521