3483. Unique 3-Digit Even Numbers Easy

@problem@discussion
#Array#Hash Table#Recursion#Enumeration



1/**
2 * [3483] Unique 3-Digit Even Numbers
3 *
4 * 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.
5 * Note: Each copy of a digit can only be used once per number, and there may not be leading zeros.
6 *  
7 * <strong class="example">Example 1:
8 * <div class="example-block">
9 * Input: <span class="example-io">digits = [1,2,3,4]</span>
10 * Output: <span class="example-io">12</span>
11 * Explanation: The 12 distinct 3-digit even numbers that can be formed are 124, 132, 134, 142, 214, 234, 312, 314, 324, 342, 412, and 432. Note that 222 cannot be formed because there is only 1 copy of the digit 2.
12 * </div>
13 * <strong class="example">Example 2:
14 * <div class="example-block">
15 * Input: <span class="example-io">digits = [0,2,2]</span>
16 * Output: <span class="example-io">2</span>
17 * Explanation: The only 3-digit even numbers that can be formed are 202 and 220. Note that the digit 2 can be used twice because it appears twice in the array.
18 * </div>
19 * <strong class="example">Example 3:
20 * <div class="example-block">
21 * Input: <span class="example-io">digits = [6,6,6]</span>
22 * Output: <span class="example-io">1</span>
23 * Explanation: Only 666 can be formed.
24 * </div>
25 * <strong class="example">Example 4:
26 * <div class="example-block">
27 * Input: <span class="example-io">digits = [1,3,5]</span>
28 * Output: <span class="example-io">0</span>
29 * Explanation: No even 3-digit numbers can be formed.
30 * </div>
31 *  
32 * Constraints:
33 * 
34 * 	3 <= digits.length <= 10
35 * 	0 <= digits[i] <= 9
36 * 
37 */
38pub struct Solution {}
39
40// problem: https://leetcode.com/problems/unique-3-digit-even-numbers/
41// discuss: https://leetcode.com/problems/unique-3-digit-even-numbers/discuss/?currentPage=1&orderBy=most_votes&query=
42
43// submission codes start here
44
45impl Solution {
46    pub fn total_numbers(digits: Vec<i32>) -> i32 {
47        0
48    }
49}
50
51// submission codes end
52
53#[cfg(test)]
54mod tests {
55    use super::*;
56
57    #[test]
58    fn test_3483() {
59    }
60}
61

Back
© 2026 bowen.ge All Rights Reserved.