题解 | #字符串排序#
字符串排序
https://www.nowcoder.com/practice/5af18ba2eb45443aa91a11e848aa6723
const rl = require("readline").createInterface({ input: process.stdin }); var iter = rl[Symbol.asyncIterator](); const readline = async () => (await iter.next()).value; void async function () { // Write your code here const arr = [] while(line = await readline()){ arr.push(line) } arr.splice(0, 1) arr.sort((a, b) => { return a < b ? -1 : a > b ? 1 : 0 }) arr.forEach(item => console.log(item)) }()