8. Length of Last Word
Given a string s, return the length of its last word.
उदाहरण 1:
इनपुट: s = "Hello World" आउटपुट: 5
उदाहरण 2:
इनपुट: s = " fly me to the moon " आउटपुट: 4
सीमाएँ:
1 <= s.length <= 10^4
Given a string s, return the length of its last word.
इनपुट: s = "Hello World" आउटपुट: 5
इनपुट: s = " fly me to the moon " आउटपुट: 4
1 <= s.length <= 10^4