Please enter your email address or userHandle.
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.
s = V
s = III
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)
1<=roman no range<=3999
We strongly recommend solving this problem on your own before viewing its editorial. Do you still
want to view the editorial?
Login to access your submissions.