Though leetcode mark is as easy, but I think it is thicker than I though: we need to traverse it inversely, and when current roman is small than previous one, mins current roman, otherwise add it. update: use two variable, one for storing p
Though leetcode mark is as easy, but I think it is thicker than I though: we need to traverse it inversely, and when current roman is small than previous one, mins current roman, otherwise add it.
update:
use two variable, one for storing positive number, the other storing negative number.