Scala solution. One LOC


#1

def titleToNumber(A: String): Int = {
A.foldLeft(0)((acc, ch) => acc * 26 + ch - ‘A’ + 1)
}