Help me in solving TODOLIST problem with javascript and node js

My issue

where my code is mistake?

My code

process.stdin.resume();
process.stdin.setEncoding("utf8");

// your code goes here

let inputs = "";
let testCase = 0;

function catchInput(data) {
  inputs += data; //? add data to inputs variable
  inputs = inputs.split(/\s+/).map(Number); //? create a list of data and convert to number type
}

function calculate(input) {
  let count = 0;
  input.forEach((value) => {
    if (value >= 1000) {
      count++;
    }
  });
  return count;
}

function main() {
  testCase = inputs.splice(0, 1)[0];
  for (let i = 0; i < testCase; i++) {
    const N = inputs.splice(0, 1)[0];
    const input = inputs.splice(0, N);
    const res = calculate(input);
    process.stdout.write(res + "\n");
  }
  process.exit();
  // process.stdout.write(inputs + "\n");
  // console.log(inputs)
}

process.stdin.resume();
process.stdin.setEncoding("utf8");
process.stdin.on("data", catchInput).on("end", main);

Problem Link: TODOLIST Problem - CodeChef