Easiest Java Solution [ 100% ] [ 0ms ]
Approach\n1. Check if n is even:\n   - Use the modulus operator to determine if n is even (n % 2 == 0).\n\n2. Return n if even:\n   - If n is even, return n its
# Approach\n1. **Check if `n` is even:**\n   - Use the modulus operator to determine if `n` is even (`n % 2 == 0`).\n\n2. **Return `n` if even:**\n   - If `n` is even, return `n` itself.\n\n3. **Return `n * 2` if odd:**\n   - If `n` is odd, return `n * 2` to get the smallest even multiple of `n`.\n\n# Complexity\n- Time complexity:\n**O(1)**\n\n- Space complexity:\n**O(1)**\n\n# Code\n```\nclass Solution {\n    public int smallestEvenMultiple(int n) {\n        int ans=0;\n        if(n%2==0) return n;\n        if(n%2 != 0){\n            ans=n*2;\n        }\n        return ans;\n    }\n}\n```\n\n![193730892e8675ebafc11519f6174bee5c4a5ab0.jpeg](https://assets.leetcode.com/users/images/1279e791-54da-4ad7-bcc0-b4621462617a_1718604410.416411.jpeg)\n
['Java']