258. Add Digits Given an integer num, repeatedly add all its digits until the result has only one digit, and return it. Digital root 1234567class Solution {public: int addDigits(int& n) { return n ? 1 + (n - 1) % 9: 0; }};