Amazon interview question

Leetcode Roman number converting question