Skip to content

Commit 614cf36

Browse files
authored
Update excel-sheet-column-number.cpp
1 parent 39d2336 commit 614cf36

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

C++/excel-sheet-column-number.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@ class Solution {
1515

1616
// Time: O(n)
1717
// Space: O(1)
18-
1918
class Solution2 {
2019
public:
2120
int titleToNumber(string s) {
22-
return accumulate(s.begin(), s.end(), 0,
21+
return accumulate(s.cbegin(), s.cend(), 0,
2322
[](int sum, char c) {
2423
return sum * 26 + c - 'A' + 1;
2524
});

0 commit comments

Comments
 (0)