0 votes
17 views

List<Integer> numbers = Arrays.asList(3, 2, 2, 3, 7, 3, 5);

in Education by (51.6k points)

1 Answer

0 votes

List<Integer> numbers = Arrays.asList(3, 2, 2, 3, 7, 3, 5);

//get list of unique squares

List<Integer> squaresList = numbers.stream().map( i -> i*i).distinct().collect(Collectors.toList());

by (51.6k points)

Related questions

0 votes
1 answer 9 views
0 votes
1 answer 18 views
0 votes
1 answer 18 views
0 votes
1 answer 12 views
0 votes
1 answer 13 views
0 votes
1 answer 106 views
0 votes
1 answer 19 views
...