Flow010 problem

Please help me why i am getting wrong answer:
Code is as follows:
process.stdin.resume();
process.stdin.setEncoding(‘utf8’);

// your code goes here
let inputstr = ‘’;
let currentline = 0;
process.stdin.on(‘data’, function(input){
inputstr += input
})
process.stdin.on(‘end’, function(){
inputstr = inputstr.split(’\n’)
let testcases = Number(readline())
while(testcases > 0){
let caset = readline()
if(caset == ‘B’ || caset == ‘b’){
console.log(‘Battleship’)
}else if(caset == ‘C’ || caset == ‘c’){
console.log(‘Cruiser’)
}else if(caset == ‘D’ || caset == ‘d’){
console.log(‘Destroyer’)
}else if(caset == ‘F’ || caset == ‘f’){
console.log(‘Frigate’)
}
testcases–
}
})

function readline(){
return inputstr[currentline++]
}

Hey, It would be better if you can provide the link of the problem for which you have written this code.
Also, if possible provide the link to the submission, as your code seems kind of scrambled here.