Skip to content

Commit 5397bbe

Browse files
authored
Add 168 python solution (#38)
* Add 168_Excel_Sheet_Column_Title.py, by @yuchenliu15
1 parent 1371de2 commit 5397bbe

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
class Solution:
2+
def convertToTitle(self, n: int) -> str:
3+
res = ""
4+
while n > 0:
5+
n -= 1
6+
res = chr(65 + n % 26) + res
7+
n //= 26
8+
return res

0 commit comments

Comments
 (0)