public int[] plusOne2(int[] digits) {

    if (digits == null || digits.length == 0) {
      return digits;
    }

    // set carry to 1 at beginning, smart
    int carry = 1;
    for (int i = digits.length - 1 ; i >= 0 ; i--) {

      int tmp = digits[i] + carry;
      digits[i] = tmp % 10;
      carry = tmp / 10;

      if (carry == 0) {
        return digits;
      }
    }

    int[] rst = new int[digits.length + 1];
    rst[0] = 1;
    return rst;
  }