Whole lines
Watch it run · 1 of 2
A number, then a line
1const lines = require("fs").readFileSync(0, "utf8").split("\n");2const n = Number(lines[0]);3const title = lines[1];4console.log(n, "x", title);
Memory
array lines
"3"0"Data Structures"1
Typed input
3 Data Structures
Output
(nothing yet)line 1Split the input at line breaks instead of spaces: one string per line.
step 1 of 4