标签:style return else pre def range div == 长度
class Solution: def lengthOfLastWord(self, s: str) -> int: count = 0 local_count = 0 for i in range(len(s)): if s[i] == ‘ ‘: local_count = 0 else: local_count += 1 count = local_count return count
标签:style return else pre def range div == 长度
原文地址:https://www.cnblogs.com/WJZheng/p/11402624.html