Await Then Print
JavaScript
Easy
4 views
Problem Description
Input has one line text. Print the same text, but do it inside an async function with one await.
Input Format
One line text (can have spaces).
Constraints
Text length up to 1e5.
Official Solution
const fs=require('fs');const txt=fs.readFileSync(0,'utf8');const s=txt.replace(/\
?\
$/,'');(async()=>{await Promise.resolve();process.stdout.write(s);})();
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!