Advertisement
tanglinghui

ctciCh2Q1

May 30th, 2012
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.28 KB | None | 0 0
  1.     public static void removeDuplicate(List<Integer> l){
  2.         Hashtable table = new Hashtable();
  3.         for(Iterator<Integer> iter = l.iterator();iter.hasNext();){
  4.             Integer i = iter.next();
  5.             if(table.containsKey(i)){
  6.                 iter.remove();
  7.             }else{
  8.                 table.put(i, true);
  9.             }
  10.         }
  11.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement