mirror of
https://github.com/devenperez/leetcode.git
synced 2026-06-13 23:07:08 +00:00
9 lines
201 B
Python
9 lines
201 B
Python
class Solution(object):
|
|
def lengthOfLastWord(self, s):
|
|
"""
|
|
:type s: str
|
|
:rtype: int
|
|
"""
|
|
s = s.strip()
|
|
words = s.split()
|
|
return len(words[-1]) |