381. Unique 3-Digit Even Numbers

EasyArray

You are given an array of digits called digits. Your task is to determine the number of distinct three-digit even numbers that can be formed using these digits. Note: Each copy of a digit can only be used once per number, and there may not be leading zeros.

Examples

Input: [1,2,3,4]

Output: 12

Explanation: The 12 distinct even 3-digit numbers are 124, 132, 134, 142, 214, 234, 312, 314, 324, 342, 412, 432. 222 is impossible since 2 appears only once.

Constraints

  • 3 <= digits.length <= 10
  • 0 <= digits[i] <= 9
Loading...

Run checks all cases above. Submit evaluates all test cases.