C++ a using std::accumulate solution (one line)


  • 1
    O
    return std::accumulate(s.begin() + 1, s.end(), s.front() - 'A' + 1, [](int s, int e) { return s * 26 + e - 'A' + 1; };

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.