Length of Last Word
来源:互联网 发布:基因监测与大数据分析 编辑:程序博客网 时间:2024/06/06 15:37
public class Solution { public int lengthOfLastWord(String s) { int length = 0; for (int i=s.length()-1; i>=0; i--){ if (s.charAt(i) != ' '){ length++; }else{ if (length>0){ return length; } } } return length; }}
0 0
- Length of Last Word
- Length of Last Word
- Length of Last Word
- Length of Last Word
- Length of Last Word
- Length of Last Word
- Length of Last Word
- Length of Last Word
- Length of Last Word
- Length of Last Word
- Length of Last Word
- Length of Last Word
- Length of Last Word
- Length of Last Word
- Length of Last Word
- Length of Last Word
- Length of Last Word
- Length of Last Word
- IOS设计模式之四(备忘录模式,命令模式)
- 线性表总结
- OPENFIRE+SPARK语音视频出错连不上的解决办法,倾心吐露:
- IOS设计模式之三(适配器模式,观察者模式)
- 线性表思维导图
- Length of Last Word
- iOS的观察者模式之:KVC&KVO
- 第7周项目1 电阻的串联
- IOS设计模式之二(门面模式,装饰器模式)
- WEB项目的基本架构
- ubuntu 上离线安装包制作与安装之NFS搭建
- 建立Cocos2d-x版的HelloWorld
- IOS设计模式之一(MVC模式,单例模式)
- Data Guard Physical Standby 11.2 RAC Primary to RAC Standby using a second network (Doc ID 1349977.1