in

leetcodeUserSolution

leetcodeUserSolution | code-memes, IT-memes | ProgrammerHumor.io
code-memes, IT-memes | ProgrammerHumor.io

Content

The Romans would most likely be angered by how it butchers their numeric system. Sorry guys class Solution: def romanToInt (self, s: str) – int translations "I" 1 "V": 5, "X": 10, "L’: 50, "C": 100, "D": 500, "M": 1000 number 0 s s. replace("IV" "TITI"). replace ("IX", "VIIII") 5 5. replace ("XL", "XXXX") . replace ("XC", "LXXXX" ) s s. replace ("CD", "CCCC"’) replace ("CM", "DCCCC" ) for char in s: number translations char return number