Roman to IntegerEasy

hash table math string

Convert a Roman numeral to an integer. A smaller symbol before a larger one means subtract (IV = 4); otherwise add. Two approaches — scan left→right looking ahead, or right→left tracking the previous value.

Press play to watch the algorithm run.
Metrics
Legend
How it works
0 / 0