Given a roman numeral, convert it to an integer.
Roman numerals are usually written largest to smallest from left to right, but six combinations use subtraction:
I before V (5) or X (10) → 4, 9X before L (50) or C (100) → 40, 90C before D (500) or M (1000) → 400, 900
Constraints
1 <= s.length <= 15
s contains only the characters 'I', 'V', 'X', 'L', 'C', 'D', 'M'.
Topics
StringsHash Table
Implement romanToInt in the editor and return the answer — printing it is never graded.