682. Sum of Digits in the Minimum Number

Given an integer array nums, return 0 if the sum of the digits of the minimum integer in nums is odd, or 1 otherwise.

Example 1:

Input: nums = [42, 17, 3, 56, 29, 11]

Output: 0

Explanation: The minimal element is 3, and the sum of its digits is 3, which is odd. Thus, the answer is 0.

Example 2:

Input: nums = [88, 21, 14, 35, 62]

Output: 0

Explanation: The minimal element is 14, and the sum of its digits is 1 + 4 = 5, which is odd. Thus, the answer is 0.

Now Your Turn!

Pick the correct output for the given input

Input: nums = [90, 81, 24, 15, 60, 33]

Still unsure what the problem is asking ?

Let’s go through a few more examples, step by step, to make it clearer.

Constraints:

  • 1 <= nums.length <= 100
  • 1 <= nums[i] <= 100

Hints

Frequently Occurring Doubts

Interview Follow-up Questions

0
class Solution {
public:
int sumOfDigits(vector<int>& nums) {
// Your code goes here
}
};
Test Case

Input:

Nums