Qualcomm interview question

Convert Roman number to Int