Given a Roman numeral string s, convert it to an integer. The key idea is to extract symbol values and apply subtractive notation correctly.
s = Roman numeral string
integer value of the Roman numeral
Example 1:
Input:
s = "III"
Output:
3
Explanation:
III = 1 + 1 + 1 = 3.
Example 2:
Input:
s = "MCMXCIV"
Output:
1994
Explanation:
MCMXCIV = 1000 + 900 + 90 + 4 = 1994.