fn main() { println!("Hello, world!"); } struct Solution {} impl Solution { pub fn plus_one(digits: Vec) -> Vec { let mut result = Vec::with_capacity(digits.len()+1); let mut carry = 1; for i in digits.iter().rev() { let sum = *i + carry; result.push(sum % 10); carry = sum / 10; } if carry > 0 { result.push(carry); } result.reverse(); result } }