Return the Least Positive Number Divisible by Two and n
Company: Google
Role: Software Engineer
Category: Coding & Algorithms
Difficulty: easy
Interview Round: Other
### Problem
For positive integer n, return the smallest positive integer divisible by both n and 2. A number is allowed to be its own multiple.
```cpp
class Solution {
public:
int smallestEvenMultiple(int n);
};
```
### Examples
**Example 1:**
```text
Input: n = 9
Output: 18
Explanation: Nine is odd, so its first even positive multiple is 18.
```
**Example 2:**
```text
Input: n = 14
Output: 14
Explanation: Fourteen already satisfies both divisibility requirements.
```
### Constraints
- `1 <= n <= 150`.
### Clarifying Questions
- Must the result be positive? Yes.
- Can `n` itself be the answer? Yes, if it meets both divisibility conditions.
- Is zero an allowed input? No; `n >= 1`.
```hint Check the boundary
Check the smallest permitted input and a number already divisible by two.
```
Overview: Return the smallest positive integer divisible by both the given positive number and two.