问题:
Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.
If the last word does not exist, return 0.
解答:
(这个问题不难,但是比较容易错,特别是有的情况考虑不周全)
TheOneGIS 博主文章分类:Leetcode习题解析 ©著作权
问题:
Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.
If the last word does not exist, return 0.
解答:
(这个问题不难,但是比较容易错,特别是有的情况考虑不周全)
【LeetCode】39. 组合总和
【LeetCode】705. 设计哈希集合
【LeetCode】706. 设计哈希映射
LeetCode Java Length of Last Word
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M