umdreamer / leetcodeproblems

Solutions for LeetCode OJ
3 stars 9 forks source link

2023.5.15 Problem: 58. Length of Last Word #13

Closed umdreamer closed 1 year ago

umdreamer commented 1 year ago
  1. Length of Last Word Problem Link

Given a string s consisting of words and spaces, return the length of the last word in the string.

A word is a maximal substring consisting of non-space characters only.

Example 1:

Input: s = "Hello World"
Output: 5
Explanation: The last word is "World" with length 5.

Example 2:

Input: s = "   fly me   to   the moon  "
Output: 4
Explanation: The last word is "moon" with length 4.

Example 3:

Input: s = "luffy is still joyboy"
Output: 6
Explanation: The last word is "joyboy" with length 6.

Constraints:

huangyumei1 commented 1 year ago

QQ图片20230515123703

yeyuxq commented 1 year ago

image

ZWJ2212061008 commented 1 year ago

image

xkqwww commented 1 year ago

无标题

Lggg1234 commented 1 year ago

屏幕截图 2023-05-15 145104

zangfushuo commented 1 year ago
截屏2023-05-15 15 18 31
promisewith7 commented 1 year ago

image

tangyexi commented 1 year ago
屏幕截图 2023-05-15 174001
foxbou commented 1 year ago
image
sjh397 commented 1 year ago

image

PinkyLame commented 1 year ago

image

cuixiao02 commented 1 year ago
截屏2023-05-15 18 56 32
liu-si-han commented 1 year ago
image
zhjingyan commented 1 year ago

image

daowuwu commented 1 year ago

KJIGJU`U08F`WTHUY9~VSN3

xiaolu2002 commented 1 year ago

image

12baoxingyu-6 commented 1 year ago
image
mafanjia commented 1 year ago

截屏4

htywan commented 1 year ago

12

123lrb commented 1 year ago

ID`7@L~31 Z`_M45 N8`Z3I

syr2212061031 commented 1 year ago

LPF~5 CDZK{9JS$8YKAF7}A

gusuning commented 1 year ago
屏幕截图 2023-05-15 211646
zxm-1235 commented 1 year ago

image

24zlx commented 1 year ago

联想截图_20230515213005

liuhuanyu6 commented 1 year ago

image

wangshiqi7 commented 1 year ago
截屏2023-05-15 21 28 43
naqianqpg commented 1 year ago

EA0XL(2~J328S_CY9HRN8KM

1125766961 commented 1 year ago

image

bedauern commented 1 year ago
Snipaste_2023-05-15_21-48-23
686xiaozhang commented 1 year ago

QQ截图20230515215514

FXL1006 commented 1 year ago
屏幕截图 2023-05-15 201441
shylieisme commented 1 year ago

GTFPI`KBGYWGT926}}F6O}1

zyhzxy99 commented 1 year ago

$6_6EL9LK )LJMTHXT18P(A