Simple java solution
\n    public int[] plusOne(int[] digits) {\n        for (int i = digits.length - 1; i >=0; i--) {\n            if (digits[i] != 9) {\n                digits[i]+
\n    public int[] plusOne(int[] digits) {\n        for (int i = digits.length - 1; i >=0; i--) {\n            if (digits[i] != 9) {\n                digits[i]++;\n                break;\n            } else {\n                digits[i] = 0;\n            }\n        }\n        if (digits[0] == 0) {\n            int[] res = new int[digits.length+1];\n            res[0] = 1;\n            return res;\n        }\n        return digits;\n    }
['Java']