public static void LISevenbetter (int num[]) {
        int temp[] = new int [num.length];
        int maxlen = 1;
        temp[0] = num[0];
        for (int i = 1; i < num.length; ++i) {//i is index of num
            if (num[i] > temp[maxlen - 1]) {
                temp[maxlen] = num[i];
                maxlen++;
            }
            else {
                int bottom = 0;
                int top = maxlen - 1;
                int mid = 0;
                while (top > bottom) {
                    mid = (top + bottom) / 2;
                    if (num[i] > temp[mid]) {
                        bottom = mid + 1;
                    }
                    else {
                        top = mid - 1;
                    }
                }

                temp[mid] = num[i];
            }
        }
        System.out.println(maxlen);
    }