题解 | #整型数组合并#

整型数组合并

https://www.nowcoder.com/practice/c4f11ea2c886429faf91decfaf6a310b

const readline = require("readline");

const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
});
let arr=[],count=1
rl.on("line", function (line) {
    if(count%2===0){
        arr.push(...line.split(' ').map(Number))
    }
    count++
}).on('close',()=>{
    arr.sort((a,b)=>a-b)
    arr=Array.from(new Set(arr))
    console.log(arr.join(''))
})

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务