package com.iwunu.nbiot.common.util;

import java.util.ArrayList;
import java.util.List;

/**
 * 
 * @author kinfeng
 *
 */
public class PitNumUtil {
    public static final Integer MAX_PIT_NUM=100;

    public static Integer getPitNum(List<Integer> removeList){
        if(removeList==null || removeList.size()==0){
            return 1;
        }
        List<Integer> list = pitNumList();
        list.removeAll(removeList);
        return list.get(0);
    }

    private static List<Integer> pitNumList(){
        List<Integer> pitList = new ArrayList<Integer>();
        for(int i=1;i<=MAX_PIT_NUM;i++){
            pitList.add(i);
        }
        return pitList;
    }

    public static void main(String[] args) {
        List<Integer> list1 = new ArrayList<Integer>();
        list1.add(1);

        List<Integer> list2 = new ArrayList<Integer>();
        list2.add(2);

        List<Integer> list3 = new ArrayList<Integer>();
        list3.add(3);

        System.out.println(getPitNum(list1));
        System.out.println(getPitNum(list2));
        System.out.println(getPitNum(list3));

    }
}
