Solve L99 Problem 10 with Java 8 Lambda