Easy java solution


  • 0
    F
        public int titleToNumber(String s) {
            int result = 0;
            for (char c : s.toCharArray()) {
                result = result * 26 + c - 'A' + 1;
            }
            return result;
        }
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.