longestWord (functional)