Solution to LeetCode Roman to Integer problem.
This is quite easy. Just check if the current character has a smaller value than the next character. If so, use the subtractive rule, otherwise just adds its value and continue.
Solution to LeetCode Roman to Integer problem.
This is quite easy. Just check if the current character has a smaller value than the next character. If so, use the subtractive rule, otherwise just adds its value and continue.