Skip to content

Instantly share code, notes, and snippets.

@EmmaEwert
Last active March 13, 2017 17:14
Show Gist options
  • Save EmmaEwert/e50263841252e4798605df797c305705 to your computer and use it in GitHub Desktop.
Save EmmaEwert/e50263841252e4798605df797c305705 to your computer and use it in GitHub Desktop.
public static String theLongestWord(String[] words) {
return Stream.of(words)
.reduce((a, b) -> a.length() > b.length() ? a : b)
.orElse(null);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment