LeetCode: Length of Last Word
https://leetcode.com/problems/length-of-last-word/description/
Code:
class Solution:
def lengthOfLastWord(self, s: str) -> int:
return len(s.strip().split()[-1])
Key Points:
Problem in Simple Words
We need to return the length of the las...
is-power-of-two.hashnode.dev1 min read