Skip to content

Commit 35abc63

Browse files
authored
VVI
1 parent fbd6abd commit 35abc63

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
class Solution {
2+
public:
3+
int titleToNumber(string columnTitle) {
4+
int res=0;
5+
int n = columnTitle.size();
6+
for(int i=0;i<n;i++){
7+
res+=(columnTitle[i]-'A'+1)*pow(26, n-i-1);
8+
}
9+
return res;
10+
}
11+
};

0 commit comments

Comments
 (0)