Given an array
Input 1
[ 'frozen', 'rock', 'stained', 'basket' ]
Output 1
true
Input 2
[ 'recycling', 70, 'pastime', 'animal' ]
Output 2
false
"use strict";
process.stdin.resume();
process.stdin.setEncoding("utf-8");
let inputString = "";
let currentLine = 0;
process.stdin.on("data", (inputStdin) => {
inputString += inputStdin;
});
process.stdin.on("end", (_) => {
inputString = inputString.trim().split("\n").map((str) => str.trim());
main();
});
function readLine() {
return inputString[currentLine++];
}
/*not modify anything above this line */
function main() {
const myArray = JSON.parse(readLine().replace(/'/g, '"'));
/* Write your code here */
}
Comments
Leave a comment