// https://leetcode.com/problems/smallest-even-multiple/
class Solution {
public:
int smallestEvenMultiple(int n) { return (n & 1) ? (n * 2) : n; }
};
smallest-even-multiple
Folders and files
Name | Name | Last commit date | ||
---|---|---|---|---|
parent directory.. | ||||
Name | Name | Last commit date | ||
---|---|---|---|---|
parent directory.. | ||||
// https://leetcode.com/problems/smallest-even-multiple/
class Solution {
public:
int smallestEvenMultiple(int n) { return (n & 1) ? (n * 2) : n; }
};