Strings

Roman to Integer

easy
Roman numerals are represented by seven symbols: I, V, X, L, C, D, M with values 1, 5, 10, 50, 100, 500, 1000. Usually written largest to smallest left to right. Subtractive cases: IV=4, IX=9, XL=40, XC=90, CD=400, CM=900. Given a roman numeral, convert it to an integer. Example: `romanToInt("MCMXCIV")` → `1994`.
Hint steps(0/3 revealed)
  1. 1

    Complete previous step or reveal to unlock this hint.

  2. 2

    Complete previous step or reveal to unlock this hint.

  3. 3

    Complete previous step or reveal to unlock this hint.