Roman to Integer — JavaScript easy interview problem
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`.
Tags: map, roman
Practice this Strings problem free in the JS Interview Playground with automated tests and unlockable solutions.