Created
October 13, 2015 10:00
-
-
Save vlas-ilya/750f96aacadbfcef2f2a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var titleToNumber = function (str) { | |
var result = 0; | |
str.split('').reverse().forEach(function (ch, index) { | |
result += (ch.charCodeAt(0) - 64) * Math.pow(26, index); | |
}); | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment