我应该如何将这段代码转换为伪代码?
ArrayList<Integer> check = new ArrayList<Integer>();
ArrayList<Integer> dup = new ArrayList <Integer> ();
ArrayList<Integer> nonDup = new ArrayList <Integer> ();
for (int i : listA) {
nonDup.add(i);
}
for (int i : listB) {
nonDup.add(i);
}
for (int i : listA) {
check.add(i);
}
for (int i : listB) {
if (check.contains(i)) {
dup.add(i);
nonDup.removeAll(duplicates);
}
}
Run Code Online (Sandbox Code Playgroud)
我不知道如何将for循环,add(),contains()和removeAll()方法转换为伪代码.