Algorithm · ByteDance · Medium
For an integer num where $$1 \le \mathit{num} \le 3999$$, produce its standard Roman numeral representation. Conversely, for a valid Roman numeral s within that same numeric range, determine the corresponding integer. Create these two functions: intToRoman(num) -> string romanToInt(s) -> int Requirements: Follow conventional Roman numeral notation, including subtractive pairs such as IV, IX, XL, XC, CD, CM. You may assume that every value passed to romanToInt is a…
Checking your access…