2023-07-08 18:25:39 +0300 MSK

Length of Last Word

Code

class Solution:
    def lengthOfLastWord(self, s: str) -> int:
        return len(s.split()[-1])