1085. Sum of Digits in the Minimum Number

Updated: 2024-03-12
1 min read
[]

On This Page

LeetCode problem 1085

class Solution:
    def sumOfDigits(self, nums: List[int]) -> int:
        x = min(nums)
        s = 0
        while x:
            s += x % 10
            x //= 10
        return s & 1 ^ 1