class Solution { public: vector<int> plusOne(vector<int> &digits) { // Start typing your C/C++ solution below // DO NOT write int main() function bool plus = true; vector<int>::iterator iter = digits.end(); iter--; while(plus&&iter>=digits.begin()) { *iter += 1; if(*iter > 9) { *iter = 0; } else { plus = false; } iter--; } if(plus) { digits.insert(digits.begin(),1); } return digits; } };