input: Write a function to convert Roman numerals to integers.
  assert roman_to_int('III') == 3
  assert roman_to_int('IV') == 4
  assert roman_to_int('IX') == 9
  assert roman_to_int('LVIII') == 58
  assert roman_to_int('MCMXCIV') == 1994
output: def roman_to_int(s: str) -> int:
      roman_dict = {
          'I': 1, 'V': 5, 'X': 10, 'L': 50,
          'C': 100, 'D': 500, 'M': 1000
      }
      total = 0
      prev_value = 0
      for char in reversed(s):
          value = roman_dict[char]
          if value >= prev_value:
              total += value
          else:
              total -= value
          prev_value = value
      return total