# 171. Excel Sheet Column Number

Given a column title as appear in an Excel sheet, return its corresponding column number.

## :innocent: [Solution](https://leetcode.com/problems/excel-sheet-column-number/)

{% tabs %}
{% tab title="O(s)" %}

```python
class Solution:
    def titleToNumber(self, s: str) -> int:
        
        ans = 0
        for i in range(1,len(s)+1):
            ans += (26**(i-1)) * (ord(s[-i])-64)
        return ans
```

{% endtab %}
{% endtabs %}
