Created
December 11, 2019 19:06
-
-
Save RMuskovets/75d48b317d6e09af8fabe31f71756bdf to your computer and use it in GitHub Desktop.
com.javarush.task.task36.task3605
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.javarush.task.task36.task3605; | |
import java.util.*; | |
import java.nio.file.*; | |
import java.io.*; | |
/* | |
Использование TreeSet | |
*/ | |
public class Solution { | |
public static void main(String[] args) throws IOException { | |
Files.lines(Paths.get(args[0])) | |
.map(String::toLowerCase) | |
.flatMapToInt(String::chars) | |
.distinct() | |
.filter(Character::isAlphabetic) | |
.sorted() | |
.limit(5) | |
.mapToObj(x -> (char)x) | |
.forEach(System.out::print); | |
System.out.println(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment