[leetcode] Length of Last Word
来源:互联网 发布:淘宝类目在线查询 编辑:程序博客网 时间:2024/05/28 17:07
class Solution {public: int lengthOfLastWord(string s) { int len = 0; bool flag = false; for(int i = s.size()-1;i>=0;i--) { if(s[i] == ' ' && !flag) continue; if(s[i] !=' ') { flag = true; len++; } else break; } return len; }};
0 0
- 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]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] 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 | Length of Last Word
- LeetCode - Length of Last Word
- Leetcode: Length of Last Word
- HTML 标签语义
- 关于一个int *ptr=(int *)(&a+1)问题的探讨
- MonaServer源码的编译安装
- 神经网络-向后传播java实现
- php改变图片的质量
- [leetcode] Length of Last Word
- cocos2d-x 改变sprite图片
- 菜菜鸟-Android学习笔记02-shaper的使用
- Chapter 3 Protecting the Data(1):理解权限
- django 1.7 新的migration框架,取代south
- Python数值计算工具包numpy,scipy,theano等的安装--Anaconda
- c++ primer读书笔记-第四章 数组和指针
- inet_pton, inet_ntop
- Emag eht htiw Em Pleh