Longest Word in a sentence

Longest word in a sentence

In this challenge you need to find the longest word in a sentence. If the sentence has more than one word of the same length you should pick the first one.

Example 1:

input data:
this is a sample sentence

Example 2:

input data:
Both adventure and adventist are pretty long
View Code Template
View Java Solution

Seda Kunda is a web designer and developer with a degree in Computer Science and a great passion for code. Besides code, she enjoys pepperoni pizza, watching the bachelor and sleeping in on Saturdays.
Share on FacebookShare on Google+Tweet about this on TwitterShare on LinkedIn