Leetcode, Roman To Integer, Scala, Programming, Algorithms.
val currentValue = values(c) // Get the integer value of the current Roman numeral from the array // If the current value is greater than the previous value, subtract twice the previous value // Otherwise, add the current value to the sum sum += (if (currentValue > prevValue) currentValue - 2 *