Roman to Integer
Problem Statement
Given a string in roman no format(s) your task is to convert it to an integer. Various symbols and their values are given below.
I 1
V 5
X 10
L 50
C 100
D 500
M 1000
Example 1
Example 2
Task
Complete the function romanToDecimal() which takes a string as input parameter and returns the equivalent decimal number.
Expected Time Complexity : O(|S|); |S| = length of string S.
Expected Auxiliary Space : O(1).
Constraints :
1 <= Roman number range <= 3999
0 Comments