arrow_back Back to Challenges

#13 Roman to Integer

Easy Acceptance 0%
description

Problem Description

Roman numerals are represented by seven different symbols: `I`, `V`, `X`, `L`, `C`, `D` and `M`. Given a roman numeral, convert it to an integer.

checklist Constraints

1 <= s.length <= 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].

science Examples

Case #1

In: s = "III"
Out: 3

Case #2

In: s = "LVIII"
Out: 58

Case #3

In: s = "MCMXCIV"
Out: 1994

Mastery Tags

Hash Table Math Strings

Hiring Companies

Adobe Amazon Microsoft
code

Integrated IDE

code_blocks
Coding
psychology
Aptitude