Roman to Integer
Given a valid Roman numeral string, return its integer value.
Examples
Input: "III"
Output: 3
Input: "MCMXCIV"
Output: 1994
Hints
Create a mapping of Roman numeral characters to their integer values.
Iterate through the string, adding values to a running total, but subtract the current value if it is less than the next value.
Handle the last character separately since it has no next character to compare with.
Related Problems
Roman to Integer
Given a valid Roman numeral string, return its integer value.