Array of Strings to UpperCase
https://drive.google.com/drive/folders/1vgGYsjWf_Nd2Ou4n7_Kl3QAizcaBfVos?usp=sharing
Please fill the code in "write your code here"
They were just sample outputs. There are other test cases too which should be passed
"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++];
}
/* Please do not modify anything above this line */
function main() {
const myArray = JSON.parse(readLine().replace(/'/g, '"'));
for (let i = 0; i < myArray.length; i++)
myArray[i] = myArray[i].toUpperCase();
console.log(myArray);
}
Comments
Leave a comment