// Initialize the small and large arrays
const smallArray = [1, 2, 3, 4];
const largeArray = new Array(32).fill(0);
const largeLen = largeArray.length;
const smallLen = smallArray.length;
// Fill largearray with elements from smallarray
for (let i = 0; i < largeLen; i++) {
largeArray[i] = smallArray[i % smallLen];
}
// print 1
for (let i = 0; i < largeLen; i++) {
process.stdout.write(largeArray[i] + " ");
}
console.log();
// print 2
console.log(largeArray.join(" "));
/*
run:
1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4
1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4
*/