kotlin-coding-challenges

Longest word

Instructions

Given a string implement a function which returns longest word in that string. If there are two or more words that have the same length, return the first longest word from the string. Ignore punctuation. Input string can’t be empty or blank sering.

Challenge Solution

Examples

longestWord("big flower") // flower

longestWord("this is a house") // house