题解 | #明明的随机数#
明明的随机数
http://www.nowcoder.com/practice/3245215fffb84b7b81285493eae92ff0
const lists = []
// 先读取所有行数再处理
while(line = readline()){
lists.push(+line)
}
let length = lists.length
while(length > 0){
handleList(lists)
length = lists.length
}
/* 分治 */
function handleList(list){
const count = list.shift();
const arr = list.splice(0, count)
sortnPrint(arr)
}
/* 数组排序输出 */
function sortnPrint(arr){
return [...new Set(arr)].sort((a,b)=>a-b).forEach( v=>print(v))
}