250x250
반응형
Notice
Recent Posts
Recent Comments
Link
목록length (1)
N
(Leet Code c++)Length of Last Word
58. Length of Last Word Given a string s consists of some words separated by spaces, return the length of the last word in the string. If the last word does not exist, return 0. A word is a maximal substring consisting of non-space characters only. Example 1: Input: s = "Hello World" Output: 5 Example 2: Input: s = " " Output: 0 Constraints: 1 token){ str.push_back(token); } if(str.empty()){ ret..
Leet Code 알고리즘
2021. 7. 9. 09:26