//去掉相同项(A组数据必须大于B组)
public static Object[] duplicateRemoval(String[] stra, String[] strb) {
String[] resStrArr = new String[stra.length + strb.length];
int i = 0;
for (String t : stra) {
if (Arrays.asList(strb).contains(t) == false) {
resStrArr[i] = t;
i++;
}
}
String[] resArr = new String[i];
System.arraycopy(resStrArr, 0, resArr, 0, i);
return resArr;
}
//big为大数组,master为小数组
List<Integer> duplicateRemoval(List<Integer> big, List<Integer> small) {
//新建一个新数组存储去重后的数据
List<Integer> list = new ArrayList<>();
//遍历big大数组
for (Integer t : big) {
//拿大数组的每一个数据与小数组比较,如果不相等就存入新数组list当中
if (small.contains(t) == false) {
list.add(t);
}
}
return list;
}