Sigaram interview question

Roman Numbers to Integers with optimised logic