Created
August 10, 2020 20:19
-
-
Save Choongkyu/d4f7dc19fcfa49b4842041352b037983 to your computer and use it in GitHub Desktop.
Revisions
-
Zebralight created this gist
Aug 10, 2020 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ class Solution: def titleToNumber(self, s: str) -> int: out = 0 for i, ch in enumerate(s): v = ord(ch) - 64 place = len(s) - i - 1 out += (v * 26**place) return out