def lengthOfLastWord(self, s):
if not s or len(s.strip()) < 1:
l = s.strip().split()
maybe is better
I don't think there's a need to strip s if you plan on splitting on white spaces
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.