Longest word
easyStrings10 XP
Words in sentence are separated by single spaces. Return the longest word; if several are equally long, return the first of them.
Examples
- Input: sentence = "we practise code"Output: "practise"
- Input: sentence = "abc def ghi"Output: "abc"
Examples use JSON: true/false/null are True/False/None in Python.