possible replica of Java int[] array to HashSet<Integer> but badly answered so new question.
I have a set that I'm trying to declare :
int[] flattened = Arrays.stream(arcs).flatMapToInt(Arrays::stream).toArray();
Set<Integer> set = new HashSet<Integer>(Arrays.asList(flattened));
but as the return type of Arrays.asList
is a list itself, it cannot resolve.
What would be the best method to turn a list of int[]
into Set<Integer>