Easy Approach 0ms, CPP, 0(n), Beats 100%
Intuition\n Describe your first thoughts on how to solve this problem. \nJust iterate from back instead of from front. Then keep adding and handling carry varia
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\nJust iterate from back instead of from front. Then keep adding and handling carry variable.\n# Approach\n<!-- Describe your approach to solving the problem. -->\nJust add as if adding a normal numbers\nLike if you want to add 239 + 1 then first you do 9+1 = 10, then we take 0 and carry 1.\nThis 0 above is 10%10 and 1 is 10/10. Thus, I have taken, digits[i] = add%10 and carry is add/10.\n\n\nAt the end if the carry is not 0 --> Add an element in the vector at the frontend.\nEx - 9 + 1 = 0 and carry 1\nSo insert it at the beginning as 10 to make 9+1=10\n# Complexity\n- Time complexity:$$O(n)$$\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:$$O(1)$$\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    vector<int> plusOne(vector<int>& digits) {\n        int carry = 1;\n        for(int i=digits.size() - 1; i>=0; i--){\n            int add = digits[i] + carry;\n            digits[i] = add%10;\n            carry = add/10;\n        }\n        if(carry > 0){\n            digits.insert(digits.begin(), carry);\n        }\n\n        return digits;\n    }\n};\n```
['C++']