这种题困难是不是分类错了

let arr = []
let line
while(line = readline()){
    let obj = {}
    let cur = line.split(' ');
    let list = cur[0].split('\\');
    let str = list[list.length - 1]
    let key = str.length > 16 ? str.substring(str.length - 16,str.length): str
    obj.key = key
    obj.lineCode = cur[1]
    obj.count = 1
    arr.push(obj);
}
let newArr = arr.reduce((list,item)=>{
    let index = list.findIndex((i)=>i.key == item.key && i.lineCode == item.lineCode);
    if(index > -1){
        list[index].count = list[index].count+1
    }else{
        list.push(item)
    }
    return list
},[]);
newArr.splice(0,newArr.length - 8)
newArr.map(i=>{
    console.log(`${i.key} ${i.lineCode} ${i.count}`)
})