Summer Sale is Live! Unlock 40% OFF on All Job-Oriented Training Programs – Limited Time Only! Offer Ending in
D
H
M
S
Get Now
Problem Submissions Solution

Roman Number to Integer

Difficulty: Easy

Acceptance: %

Points: 20.00

Given a string in Roman number format (s), your task is to convert it to an integer. Various symbols and their values are given below.

Note: I = 1, V = 5, X = 10, L = 50, C = 100, D = 500, M = 1000


Topics

Companies

Articles

Examples:

Expected Time Complexity: O(n)

Expected Space Complexity: O(1)

Constraints:
  • 1<= roman number <=3999
  • s[i] belongs to [I, V, X, L, C, D, M]
Companies:
Amazon Microsoft Zoho
Topics:
String
Locked Content
Access Restricted: Please Login to access the code editor and test cases.