2094. Finding 3-Digit Even Numbers Easy

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



1/**
2 * [2094] Finding 3-Digit Even Numbers
3 *
4 * You are given an integer array digits, where each element is a digit. The array may contain duplicates.
5 * You need to find all the unique integers that follow the given requirements:
6 * 
7 * 	The integer consists of the concatenation of three elements from digits in any arbitrary order.
8 * 	The integer does not have leading zeros.
9 * 	The integer is even.
10 * 
11 * For example, if the given digits were [1, 2, 3], integers 132 and 312 follow the requirements.
12 * Return a sorted array of the unique integers.
13 *  
14 * Example 1:
15 * 
16 * Input: digits = [2,1,3,0]
17 * Output: [102,120,130,132,210,230,302,310,312,320]
18 * Explanation: All the possible integers that follow the requirements are in the output array. 
19 * Notice that there are no odd integers or integers with leading zeros.
20 * 
21 * Example 2:
22 * 
23 * Input: digits = [2,2,8,8,2]
24 * Output: [222,228,282,288,822,828,882]
25 * Explanation: The same digit can be used as many times as it appears in digits. 
26 * In this example, the digit 8 is used twice each time in 288, 828, and 882. 
27 * 
28 * Example 3:
29 * 
30 * Input: digits = [3,7,5]
31 * Output: []
32 * Explanation: No even integers can be formed using the given digits.
33 * 
34 *  
35 * Constraints:
36 * 
37 * 	3 <= digits.length <= 100
38 * 	0 <= digits[i] <= 9
39 * 
40 */
41pub struct Solution {}
42
43// problem: https://leetcode.com/problems/finding-3-digit-even-numbers/
44// discuss: https://leetcode.com/problems/finding-3-digit-even-numbers/discuss/?currentPage=1&orderBy=most_votes&query=
45
46// submission codes start here
47
48impl Solution {
49    pub fn find_even_numbers(digits: Vec<i32>) -> Vec<i32> {
50        vec![]
51    }
52}
53
54// submission codes end
55
56#[cfg(test)]
57mod tests {
58    use super::*;
59
60    #[test]
61    fn test_2094() {
62    }
63}
64


Back
© 2025 bowen.ge All Rights Reserved.