One more example on K-Permutation
fengertao opened this issue · 1 comments
fengertao commented
Original k-permutation example print output into console. while cannot collect result into a collection for further processing.
Generator.combination("1", "2", "3", "4")
.simple(2)
.stream()
.forEach(combination -> Generator.permutation(combination)
.simple()
.stream()
.forEach(System.out::println))
Below example collect result into a collection for further processing
List<List<String>> kPermutationResult = Generator.combination("1", "2", "3", "4")
.simple(2)
.stream()
.flatMap(combination -> Generator.permutation(combination)
.simple()
.stream()
)
.collect(Collectors.toList());
fengertao commented
Cancel this issue, for new k-permutation API provided reason