Dell Technologies interview question

Convert roman to integer in Java