Roman to Integer
Given a roman numeral, convert it to an integer.

30:00

Roman to Integer
easy
Topics
Companies

Given a roman numeral, convert it to an integer.

Example 1:
Input: "III"
Output: 3
Constraints:
  • 1s.length151 \leq s.\text{length} \leq 15

  • s contains only the characters ('I', 'V', 'X', 'L', 'C', 'D', 'M').

  • It is guaranteed that s is a valid Roman numeral in the range [1,3999][1, 3999].

Input
arr ="III"

Convert roman

s
iI0I1I2
Variables
VariableValue
sIII
DepthFunction Call
Stack empty
0/4