LeetCode-58-Length of Last Word 水题
来源:互联网 发布:淘宝买家微信付款骗局 编辑:程序博客网 时间:2024/06/05 02:07
class Solution(object): def lengthOfLastWord(self, s): """ :type s: str :rtype: int """ Len=len(s) endP=Len-1 flag=-1 while(endP>=0): if s[endP]!=' ': flag=endP break endP-=1 if flag==-1:return 0 ans=0 for i in range(flag,-1,-1): if s[i]!=' ': ans+=1 else:break return ans
阅读全文
1 0
- LeetCode-58-Length of Last Word 水题
- [leetcode 58] Length of Last Word
- leetcode-58 Length of Last Word
- Leetcode NO.58 Length of Last Word
- LeetCode #58 length of Last Word
- [LeetCode 58]Length of Last Word
- leetcode || 58、Length of Last Word
- LeetCode 58 Length of Last Word
- [Leetcode 58, easy] Length of Last Word
- Length of Last Word (leetCode 58)
- leetcode[58]:Length of Last Word
- 【leetcode c++】58 Length of Last Word
- leetcode 58:Length of Last Word
- LeetCode---(58)Length of Last Word
- leetcode-58-Length of Last Word
- Leetcode# 58 Length of Last Word
- [leetcode-58]Length of Last Word(c)
- leetcode 58: Length of Last Word
- Angular面试方面的问题
- 用一句话记录我的心情
- 文章标题
- 关于二叉树的创建、遍历等问题
- WEB相关知识点
- LeetCode-58-Length of Last Word 水题
- by分组和class分组的区别
- 网络流板子之 dinic板子
- js获取上传文件的大小(字节数)
- XML fragments parsed from previous mappers already contains value for com.mybatis_test.dao.StudentMa
- Hibernate 简单总结
- rabbitmq 简介
- Android 多线程之IntentService 完全详解
- 第三章 进程管理