roman numeral represent seven different symbol I v X l C D MSymbol ValueI 1V 5x 10L 50c 100d 500 M 1000for example 2 write II roman numeral one add 12 write XII simply X II the number 27 write XXVII XX V IIRoman numeral usually write large small left right however numeral iiii instead number write IV because subtract make the principle apply number write IX there instance subtraction usedi place V 5 x 10 4 9 x place l 50 C 100 40 90 c place D 500 M 1000 400 900given roman numeral convert integer Example 1input s iiioutput 3explanation III 3example 2input s LVIIIOutput 58explanation L 50 V 5 iii 3example 3input s MCMXCIVOutput 1994explanation M 1000 CM 900 XC 90 IV 4 Constraints1 slength 15s contain character I v X l C D MIt guarantee s valid roman numeral range 1 3999