Skip to content

Commit 1c7c238

Browse files
committed
Add solution #2413
1 parent 9bbaa36 commit 1c7c238

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@
310310
2235|[Add Two Integers](./2235-add-two-integers.js)|Easy|
311311
2244|[Minimum Rounds to Complete All Tasks](./2244-minimum-rounds-to-complete-all-tasks.js)|Medium|
312312
2396|[Strictly Palindromic Number](./2396-strictly-palindromic-number.js)|Medium|
313+
2413|[Smallest Even Multiple](./2413-smallest-even-multiple.js)|Easy|
313314
2427|[Number of Common Factors](./2427-number-of-common-factors.js)|Easy|
314315
2469|[Convert the Temperature](./2469-convert-the-temperature.js)|Easy|
315316
2482|[Difference Between Ones and Zeros in Row and Column](./2482-difference-between-ones-and-zeros-in-row-and-column.js)|Medium|
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/**
2+
* 2413. Smallest Even Multiple
3+
* https://leetcode.com/problems/smallest-even-multiple/
4+
* Difficulty: Easy
5+
*
6+
* Given a positive integer n, return the smallest positive integer that is a multiple of both 2 and n.
7+
*/
8+
9+
/**
10+
* @param {number} n
11+
* @return {number}
12+
*/
13+
var smallestEvenMultiple = function(n) {
14+
return n * (n % 2 + 1);
15+
};

0 commit comments

Comments
 (0)