Roman To Integer

Given a roman numeral, convert it to an integer.

Input is guaranteed to be within the range from 1 to 3999.

Read more details about roman numerals at Roman Numeric System

Example :

Input : "XIV"
Return : 14
Input : "XX"
Output : 20
Interview Code Editor
Hints
  • Solution Approach
  • Complete Solution
6057 successful submissions.
Asked In:
  • Amazon
  • Facebook
  • Microsoft
  • Twitter
Click here to jump start your coding interview preparation