今天项目需要 有交集返回false 场景如下
前端传几组数字 比如:
3 5
8 20
7 10
3 5 和8 20 不存在交集
但 8 20 和 7 10存在交集
这三组数字返回false
如果是这两组:
3 5
8 20
就返回true了
请问java代码怎么实现呢
今天项目需要 有交集返回false 场景如下
前端传几组数字 比如:
3 5
8 20
7 10
3 5 和8 20 不存在交集
但 8 20 和 7 10存在交集
这三组数字返回false
如果是这两组:
3 5
8 20
就返回true了
请问java代码怎么实现呢
实体
/**
Created by admin on 2018/6/20.
*/
public class NumEntity {
private Integer x;
private Integer y;
public Integer getX() {
return x;
}
public void setX(Integer x) {
this.x = x;
}
public Integer getY() {
return y;
}
public void setY(Integer y) {
this.y = y;
}
public NumEntity(Integer x, Integer y) {
this.x = x;
this.y = y;
}
}
主类
/**
Created by admin on 2018/6/20.
*/
public class CsdnMain {
/**
/**
/**
}