GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — leetcode-1/python/058_Length_of_Last_Word.py at master · swekul/leetcode-1 Expand file tree/ Copy path058_Length_of_Last_Word.pyMore file actions 14 lines (14 loc) · 338 Bytes / Copy path058_Length_of_Last_Word.pyFile metadata and controls14 lines (14 loc) · 338 Bytes 1 2 3 4 5 6 7 8 9 10 11 12 13 14 class Solution(object): def lengthOfLastWord(self, s): """ :type s: str :rtype: int """ if len(s) == 0: return 0 temp = s.split(' ') temp = [t for t in temp if len(t) > 0] if len(temp) == 0: return 0 else: return len(temp[-1]) |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |