public static int[] plusOne(int[] digits) {
		int n = digits.length;
		boolean flag = true;
		for (int i : digits) {
			if (i != 9) {
				flag = false;
				break;
			}
		}
		int[] result = null;
		if (flag) {
			n++;
			result = new int[n];
		} else {
			result = new int[n];
		}
		// use for the iteration
		n--;
		int carry = 1;
		for (int i = digits.length - 1; i >= 0; i--) {
			int temp = digits[i];
			temp += carry;
			carry = temp / 10;
			temp = temp % 10;
			result[n--] = temp;

		}
		if (carry != 0) {
			result[0] = carry;
		}
		return result;

	}