public int removeDuplicates_lint(int[] nums) {
        // write your code here
        if (nums == null || nums.length == 0)
            return 0;
        int index = 0;
        for (int i = 0; i < nums.length; ++i) {
            if (nums[index] != nums[i]) {
                nums[++index] = nums[i];
            }
        }
        return index + 1;
    }