2413. Smallest Even Multiple Easy
1/**
2 * [2413] Smallest Even Multiple
3 *
4 * Given a positive integer n, return the smallest positive integer that is a multiple of both 2 and n.
5 *
6 * Example 1:
7 *
8 * Input: n = 5
9 * Output: 10
10 * Explanation: The smallest multiple of both 5 and 2 is 10.
11 *
12 * Example 2:
13 *
14 * Input: n = 6
15 * Output: 6
16 * Explanation: The smallest multiple of both 6 and 2 is 6. Note that a number is a multiple of itself.
17 *
18 *
19 * Constraints:
20 *
21 * 1 <= n <= 150
22 *
23 */
24pub struct Solution {}
25
26// problem: https://leetcode.com/problems/smallest-even-multiple/
27// discuss: https://leetcode.com/problems/smallest-even-multiple/discuss/?currentPage=1&orderBy=most_votes&query=
28
29// submission codes start here
30
31impl Solution {
32 pub fn smallest_even_multiple(n: i32) -> i32 {
33 0
34 }
35}
36
37// submission codes end
38
39#[cfg(test)]
40mod tests {
41 use super::*;
42
43 #[test]
44 fn test_2413() {
45 }
46}
47
Back
© 2025 bowen.ge All Rights Reserved.