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.
IV