Ctrl K

Digit Parity of the Minimum

Easy
You are given an array of positive integers numbers. Find the smallest number in it and add up its decimal digits. Return 1 if that sum is even and 0 if it is odd.
Example 1
numbers=[48, 19, 62, 30] → 1

The smallest is 19; its digits add up to 1 + 9 = 10, which is even, so the answer is 1.

Example 2
numbers=[56, 70, 23] → 0

The smallest is 23; its digit sum 5 is odd, so the answer is 0.

Example 3
numbers=[100] → 0

The digits of 100 add up to 1, which is odd, so the answer is 0.

Constraints
  • 1 ≤ numbers.length ≤ 100
  • 1 ≤ numbers[i] ≤ 10⁹
Have you seen this problem in a real interview?
Solved by0
Tried by0
Submissions0
Acceptance—
Topics
Similar problemsAdd One to a Digit Array EasyThe Lost Ticket EasyCorner Stamps on a Table EasyBest Product of Three EasyThe Biggest Triangle on the Board Easy
loading Python…
Input
numbers=[48, 19, 62, 30]
Expected
1

Run checks the first 3 tests in your browser. Submit checks all 123 tests on the server, hidden ones included.