Excel Sheet Column Number LeetCode solution in C++
1// ��������Please upvote if it helps ��������2class Solution {3public:4int titleToNumber(string columnTitle) {5int result = 0;6for (char c : columnTitle) {7// d = s[i](char) - 'A' + 1 (we used s[i] - 'A' to convert the letter to8// a number like it's going to be C)910int d = c - 'A' + 1;11result = result * 26 + d;12}13return result;14}15};