var romanToInt = function (s) {
const object = {
'I': 1,
'V': 5,
'X': 10,
'L': 50,
'C': 100,
'D': 500,
'M': 1000
}
let count =0
console.log(object)
for(i =0; i<s.length;i++){
const cur = object[s[i]]
const next = object[s[i+1]]
if(cur<next){
count += next-cur
i++
}else{
count+= cur
}
}
return count
};