const duplicateZeros = function (arr) {
const newArray = [];
for (let i = 0; i < arr.length; i++) {
if (arr[i] == 0) {
newArray.push(0);
newArray.push(0);
} else {
newArray.push(arr[i]);
}
}
for (let i = 0; i < arr.length; i++) {
arr[i] = newArray[i]
}
return newArray;
};
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)