Flipping bits

  • + 0 comments

    I'm having a bug with the provided code on Javascript (Node.js):

    When using a custom input and giving the number 10, the code returns:

    /tmp/submission/20230310/12/14/hackerrank-6cdd7f5bdecf1ec8810a6eaa9da773be/code/Solution.js:52 const n = parseInt(readLine().trim(), 10); ^ TypeError: Cannot read properties of undefined (reading 'trim') at main (/tmp/submission/20230310/12/14/hackerrank-6cdd7f5bdecf1ec8810a6eaa9da773be/code/Solution.js:52:38) at Socket. (/tmp/submission/20230310/12/14/hackerrank-6cdd7f5bdecf1ec8810a6eaa9da773be/code/Solution.js:18:5) at Socket.emit (node:events:525:35) at endReadableNT (node:internal/streams/readable:1359:12) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) Node.js v18.6.0