sum([26**i*(string.uppercase.index(c)+1) for (c,i) in zip(s[::-1],range(0,len(s)))])
In code golf, one fights for every single keystroke... you're wasting quite a few that can simply be deleted. And quite a few more, like by doing work to get c and then not using it.
Thanks. That was a mistake. Fixed.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.