public int[] plusOne(int[] digits) {
        int[] array = new int[digits.length + 1];
        int val = 1;
        for(int i =digits.length-1 ; i>=0 ;i--){
            val = digits[i]+val;
            array[i+1] = val % 10;
            val = val /10;
        }
        array[0] = val;
        return (val == 0)? Arrays.copyOfRange(array,1,array.length): array;
    }