网页学习体会

  • 首页
  • 个人博客
您的位置: 首页  >  IT文章  >  LeetCode-Length of Last Word

LeetCode-Length of Last Word

分类: IT文章 • 2022-06-14 00:02:16
LeetCode--Length of Last Word

题目:

LeetCode-Length of Last Word

解决方法:

public class Solution {
    public int lengthOfLastWord(String s) {
        if (s.trim().length() == 0) {
            return 0;
        }
        String[] str = s.split(" ");
        return str[str.length - 1].length();
    }
}


相关推荐

  • 139. Word Break
  • NLP系列2:Word2Vec理论及实战 提出 基础知识 背景知识 Word2Vec实现
  • 使用Word发布文章到 WordPress 博客
  • 通过编写 shell 脚本实现二进制安装 LAMP 架构的 word press
  • 如何编辑Microsoft Office Word 2003默认的Normal.dot模板文件
  • 安装PowerDesigner 12之后,在Microsoft Office Word 2003的模板和插件中无法移除WordToRqm.dot的解决方案
  • 牛客SQL题解-创建一个actor_name表,并且将actor表中的所有first_name以及last_name导入该表
  • 牛客SQL题解-对first_name创建唯一索引uniq_idx_firstname,对last_name创建普通索引idx_lastname
  • Python- 【python无法更新pip】提示python.exe: No module named pip 安装excel,word第三方库
  • 将word中的标题和正文按照大纲等级导入到excel中
  • 一个关于单纯词计数的程序
  • 康托铺展及其逆运算 详解
    网站免责声明 网站地图 最新文章 用户隐私 版权申明
本站所有数据收集于网络,如果侵犯到您的权益,请联系网站进行下架处理。   

Copyright © 2018-2021   Powered By 网页学习体会    备案号:   粤ICP备20002247号