APNA OA Hiring | Smallest Even Multiple | On-Campus (2024)
Question · Posted Jun 2026
Problem Statement Given a positive integer n, return the smallest positive integer that is a multiple of both 2 and n. In other words, find the Least Common Multiple (LCM) of 2 and n. Example 1 Input n = 5 Output 10 Explanation Multiples of 5 : 5, 10, 15, 20... Multiples of 2 : 2, 4, 6, 8, 10... Smallest common multiple = 10 Example 2 Input n = 6 Output 6 Explanation 6 is already even and divisible ...
The full answer & interview discussion are available to premium members.
Log in Create a free account