Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static int supprime(List<Integer> a, List<Integer> b){
- ListIterator<Integer> ita = a.listIterator();
- ListIterator<Integer> itb = b.listIterator();
- int count = 0;
- while(ita.hasNext() && itb.hasNext()){
- int valeurA = ita.next();
- int valeurB = itb.next();
- if(valeurA < valeurB) itb.previous();
- else if(valeurB < valeurA) ita.previous();
- else{
- itb.remove();
- count++;
- }
- }
- return count;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement