Given a string s consisting of words separated by spaces, return the longest word in the sentence.
If there are multiple words with the same maximum length, return the first one that appears.
A word is defined as a sequence of non-space characters.
s = "the quick brown fox""quick"s = "hello""hello"s = "I love programming""programming"1 <= s.length <= 10^4s contains only lowercase English letters and spacess does not contain leading or trailing spacesWords are separated by a single spaceRun your code to see results
Use Cmd+Enter to run