Rust Solution
Complexity\n- Time complexity: O(k.d) , where kk is the number of elements in nums and dd is the average number of digits in the numbers.\n\n Add your time comp
# Complexity\n- Time complexity: O(k.d) , where kk is the number of elements in nums and dd is the average number of digits in the numbers.\n\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```rust []\nimpl Solution {\n    fn sum_of_digits(mut num: i32) -> i32 {\n        let mut sum = 0;\n        while num > 0 {\n            sum += num % 10;\n            num /= 10;\n        }\n        sum\n    }\n    pub fn min_element(nums: Vec<i32>) -> i32 {\n        nums.iter()\n            .map(|&num| Self::sum_of_digits(num))\n            .min()\n            .unwrap_or(0)\n    }\n}\n\n```
['Rust']