434.Number of Segments in a String
434.Number of Segments in a String
难度:Easy
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.
以空格分割,然后找出最后一个空格之后是否有单词即可。
执行用时 :0 ms, 在所有 C++ 提交中击败了100.00%的用户 内存消耗 :8.2 MB, 在所有 C++ 提交中击败了90.29%的用户
Last updated