- it should not include repeated points; that is, points with the same coordinates.
- and it should not include points with negative coordinates.
This is what I have got so far, but I'm struggling to do the same with y coordinate.
static List<Point> ex5(List<Integer>xs, List<Integer> ys){
List<Point> p = xs.stream()
.map(e -> new Point(e , 0))
.collect(Collectors.toList());
return p ;
}
Below is the sample data. Any idea what I am missing here?
List<Integer> pointx = new ArrayList<>();
pointx.add(1);
pointx.add(-2);
pointx.add(3);
pointx.add(4);
pointx.add(1);
List<Integer> pointy = new ArrayList<>();
pointy.add(6);
pointy.add(7);
pointy.add(8);
pointy.add(9);
pointy.add(6);