Given a positive integer n, return the smallest positive integer that is a multiple of both 2 and n.
class Solution(object):
def smallestEvenMultiple(self, n):
"""
:type n: int
:rtype: int
"""
res = 2
while True:
if res % n == 0:
return res
res += 2
Top comments (0)