2022-09-19 22:42:50 +08:00
Given a < strong > positive< / strong > integer < code > n< / code > , return < em > the smallest positive integer that is a multiple of < strong > both< / strong > < / em > < code > 2< / code > < em > and < / em > < code > n< / code > .
< p > < / p >
2023-12-09 18:42:21 +08:00
< p > < strong class = "example" > Example 1:< / strong > < / p >
2022-09-19 22:42:50 +08:00
< pre >
< strong > Input:< / strong > n = 5
< strong > Output:< / strong > 10
< strong > Explanation:< / strong > The smallest multiple of both 5 and 2 is 10.
< / pre >
2023-12-09 18:42:21 +08:00
< p > < strong class = "example" > Example 2:< / strong > < / p >
2022-09-19 22:42:50 +08:00
< pre >
< strong > Input:< / strong > n = 6
< strong > Output:< / strong > 6
< strong > Explanation:< / strong > The smallest multiple of both 6 and 2 is 6. Note that a number is a multiple of itself.
< / pre >
< p > < / p >
< p > < strong > Constraints:< / strong > < / p >
< ul >
< li > < code > 1 < = n < = 150< / code > < / li >
< / ul >