# 168. Excel Sheet Column Title

```python
class Solution:
    def convertToTitle(self, n: int) -> str:
        alp = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
        return self.helper(n, alp)
    
    def helper(self, n, alp): 
        if n <= 26:
            return alp[n-1]     
        ch = alp[n%26-1]
        return self.helper(n//26, alp)+ch
```

该怎么计算时间复杂度呢？ $$O(log\_{26}^n)$$ --->  $$O(lgn)$$？ 空间复杂度也是一样的？


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://r24zeng.gitbook.io/leetcode-notebook/bu-chong-4060-dao/168.-excel-sheet-column-title.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
