Link: https://leetcode.com/problems/roman-to-integer/
Solution:
Topics: math
Intuition
This problem is quite simple once you wrap your head around the logic. Basically, each letter in the roman numeral maps to a positive value UNLESS its followed by a larger letter…in that case the contribution of the letter is negative.
The last letter can never be negative because nothing follows it.
Implementation
Visual