https://leetcode.com/problems/roman-to-integer/#/description
class Solution(object):
def romanToInt(self, s):
"""
:type s: str
:rtype: int
"""
romanMap = {'I':1, 'V':5, 'X':10, 'L':50, 'C':100, 'D':500, 'M':1000}
ret=0
for ind in xrange(len(s)-1):
if romanMap[s[ind]]<romanMap[s[ind+1]]:
ret-=romanMap[s[ind]]
else:
ret+=romanMap[s[ind]]
ret+=romanMap[s[-1]]
return ret