Skip to content
Veltoryx Technologies
ProProblem 10● EasyLeetCode #13 ↗2 min readUpdated 30 October 2026

Roman to Integer

Convert a Roman numeral to a number by adding each symbol, or subtracting it when a bigger symbol follows.

01The problem

Convert a Roman numeral s to an integer. Symbols: I = 1, V = 5, X = 10, L = 50, C = 100, D = 500, M = 1000. A smaller symbol before a bigger one is subtracted (IV = 4, IX = 9, XC = 90).

InputOutput
"III"3
"LVIII"58
"MCMXCIV"1994

Loading the rest of the lesson…