Async Even or Odd
JavaScript
Easy
3 views
Problem Description
Given an integer n, write async function that returns EVEN or ODD. Print it.
Input Format
One integer n.
Output Format
EVEN or ODD.
Constraints
n is integer.
Official Solution
const fs=require('fs');const s=fs.readFileSync(0,'utf8').trim();if(!s)process.exit(0);const n=BigInt(s);const check=async v=>{await Promise.resolve();return v%2n===0n?'EVEN':'ODD';};(async()=>{process.stdout.write(await check(n));})();
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!