Skip to content

Instantly share code, notes, and snippets.

@oreillyross
Created October 22, 2021 14:09
Show Gist options
  • Save oreillyross/7be778c0619499d2617e0315104c784a to your computer and use it in GitHub Desktop.
Save oreillyross/7be778c0619499d2617e0315104c784a to your computer and use it in GitHub Desktop.
/**
* @param {string} s
* @return {number}
*/
var romanToInt = function(s) {
let sum = 0;
let remainingS = s;
const symbols = {
'IV':4,
'IX':9,
'XL':40,
'XC':90,
'CD':400,
'CM':900,
'I': 1,
'V': 5,
'X': 10,
'L': 50,
'C': 100,
'D': 500,
'M': 1000,
};
Object.keys(symbols).map((sym) => {
while ()
})
return sum;
};
console.log(romanToInt('IV'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment