public static int findMissing(int[] data) {
        if(data.length <=2)
            return -1;
        int start = data[0];
        int end = data[data.length - 1];
        int sum = (start + end)*(end - start + 1)/2;
        int _sum = 0;
        for(int i : data){
            _sum += i;
        }
        if(sum > _sum)
            return sum - _sum;
        else
            return -1;

    }