-
Notifications
You must be signed in to change notification settings - Fork 0
258_AddDigits
a920604a edited this page Apr 14, 2023
·
1 revision
class Solution {
public:
int addDigits(int num) {
int n = num ;
while(n>=10){
int sum = 0;
while(n){
sum+=(n%10);
n/=10;
}
n = sum;
}
return n;
}
};
footer