JAVA recursion solution
public class Solution {\n        public int[] plusOne(int[] digits) {\n            return helper(digits,digits.length-1);\n        }\n        \n        private 
    public class Solution {\n        public int[] plusOne(int[] digits) {\n            return helper(digits,digits.length-1);\n        }\n        \n        private int[] helper(int[] digits, int index){\n            if(digits[index] < 9){\n                digits[index]++;\n                return digits;\n            }else{\n                if(index != 0){\n                    digits[index] = 0;\n                    return helper(digits,index-1);\n                }else{\n                    int[] res = new int[digits.length+1];\n                    res[0] = 1;\n                    return res;\n                }\n            }\n        }\n    }
[]