You are viewing a single comment's thread. Return to all comments →
const lines = input.split('\n'); const n = parseInt(lines[0], 10); for (let i = 1; i <= n; i++) { let evenStr = ""; let oddStr = ""; for (j = 0; j <= lines[i].length - 1; j++) { if (j % 2 === 0) { evenStr = evenStr + lines[i][j] } else { oddStr = oddStr + lines[i][j] } } console.log(evenStr,oddStr) }
Seems like cookies are disabled on this browser, please enable them to open this website
Day 6: Let's Review
You are viewing a single comment's thread. Return to all comments →