leetcode 434[easy]---Number of Segments in a String

来源:互联网 发布:男生护肤品知乎 编辑:程序博客网 时间:2024/05/20 04:50
   

Count the number of segments in a string, where a segment is defined to be a contiguous sequence of non-space characters.

Please note that the string does not contain any non-printable characters.

Example:

Input: "Hello, my name is John"Output: 5


Seen this question in a real interview before?  No
Thanks for your feedback.

思路:用s.split()以空格键分割string,并以list形式输出


阅读全文
'); })();
0 0
原创粉丝点击
热门IT博客
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 jiangnan 我凡间来想见江南 江口 江口镇 江口县 江口是哪 图们江口 灌江口 瓯江口 大唐召唤录 江口1999 江口县门户网 江口门户网 江右 江吟 幕江吟 慕江吟 薯江吟 江哲 江团的做法 江城叶辰 江城子 江城 江城林阳 江城江暖暖 江城警事 上海江城 江城子苏轼 江城皮肤 江城皮肤科 江城暖暖 苏轼江城子 江城骨科 江暖暖江城 江城县 江城在哪里 江城在哪 江城足球网 江城是哪里 江城子密州出猎 江城密州出猎 上海江城医院