Length of Last Word (1) 썸네일형 리스트형 [LeetCode] Length of Last Word | 난이도: Easy 문제 Given a string s consisting of some words separated by some number of spaces, return the length of the last word in the string. A word is a maximal substring consisting of non-space characters only. 예시 Example 1: Input: s = "Hello World" Output: 5 Explanation: The words are "Hello" and "World", both of length 5. Example 2: Input: s = " fly me to the moon " Output: 4 Explanation: The longest w.. 이전 1 다음