Thursday, October 2, 2014

Roman to Integer

Problem

Given a roman numeral, convert it to an integer.
Input is guaranteed to be within the range from 1 to 3999.

Idea

一定要注意好radix和symbol两个数组的顺序,依次遍历s,把找到的子串删掉,然后继续,并更新result.

Solution


No comments:

Post a Comment