3300. 替换为数位和以后的最小元素
题目链接:
https://leetcode.cn/problems/minimum-element-after-replacement-with-digit-sum/
题解代码:
int minElement(int* nums, int numsSize) {
int temp=10000;
while (numsSize--) {
int a=0;
while (nums[numsSize]) {
a += nums[numsSize] % 10;
nums[numsSize] /= 10;
}temp = temp > a ? a : temp;
}return temp;
}