// returns selected, rest static Pair> selectRandom2(L list, int n) { if (l(list) < n) null; new L l; list = cloneList(list); repeat n { int i = rand(l(list)); l.add(list.get(i)); list.remove(i); } ret pair(l, list); }