Leetcode, Roman To Integer, Scala, Programming, Algorithms.
object Solution { def romanToInt(s: String): Int = { var sum = 0 // Initialize the total sum var prevValue = 0 // Initialize the value of the previous Roman numeral val value = Map( 'I' -> 1, 'V' -> 5, 'X' -> 10, 'L' -> 50, 'C' -> 100, 'D' -> 500, 'M' -> 1000 ) for (c <- s) { // Iterate through