Python学习——leetcode(Length of Last Word)
来源:互联网 发布:为什么俞飞鸿抗老 知乎 编辑:程序博客网 时间:2024/06/06 15:46
class Solution: # @param s, a string # @return an integer def lengthOfLastWord(self, s):words=s.strip()#去掉前后空格if words:if words.count(' ')==0:#统计内部空格return len(words)else:word=words.split()#根据空白拆分return len(word[len(word)-1])else:return 0
0 0
- Python学习——leetcode(Length of Last Word)
- LeetCode——Length of Last Word
- LeetCode——Length of Last Word
- leetcode——Length of Last Word
- LeetCode—Length of Last Word
- 【LeetCode with Python】 Length of Last Word
- LeetCode--Length of Last Word (Python)
- 58. Length of Last Word Leetcode Python
- [leetcode:python]58.Length of Last Word
- 【Leetcode】【python】Length of Last Word
- leetcode——58——Length of Last Word
- leetcode 058 —— Length of Last Word
- leetcode刷题日记—— Length of Last Word
- Leetcode Problem.58—Length of Last Word
- LeetCode 之 Length of Last Word — C 实现
- LeetCode: Length of Last Word
- LeetCode Length of Last Word
- LeetCode : Length of Last Word
- IOS用CGContextRef画各种图形(文字、圆、直线、弧线、矩形、扇形、椭圆、三角形、圆角矩形、贝塞尔曲线、图片)
- WinForm-TextRenderer
- AndroidMenu的应用之OptionMenu的应用
- Spring MVC 框架搭建及详解
- 四种常见的 POST 提交数据方式
- Python学习——leetcode(Length of Last Word)
- android 二次开发 莫名其妙问题三(版本控制问题)
- Hibernate current_session_context_class的事务说明
- 利用FFmpeg将 IPCamera 的RTSP转码成RTMP发布在RED5
- 深圳布吉妇科医院怎么样
- Android之四种加载方式
- 【HeadFirst 设计模式学习笔记】13 MVC分析
- 视频编解码项目经验
- 设备的64位 MAC地址是怎么样选取的?