Leetcode, Roman To Integer, Scala, Programming, Algorithms.
value of the previous Roman numeral val values = Array.fill(256)(0) // Array of size 256, all initialized to 0 values('I') = 1; values('V') = 5; values('X') = 10; values('L') = 50 values('C') = 100; values('D') = 500; values('M') = 1000 for (c <- s) { // Iterate through each character in the string