168_Excel Sheet Column Title
Given a positive integer, return its corresponding column title as appear in an Excel sheet.
For example:
Solution: recursive
We can divide the number by 26 repeatedly to get the number on each decimal, an then convert to the corresponding letter.
Note:
rule is set from 0 to 25, correspondingly use compute output for n-1
, to avoid 26 not assigned to Z
Solution: Iterative
Last updated