fork(1) download
  1. const readline = require('readline');
  2.  
  3. const rl = readline.createInterface({
  4. input: process.stdin,
  5. output: process.stdout
  6. });
  7.  
  8. let arr = Array.apply(null, Array(10001)).map(() => 0);
  9.  
  10. (async() => {
  11. let skip = 1;
  12. for await (let i of rl) {
  13. if (skip) {
  14. skip = 0;
  15. continue;
  16. }
  17. arr[parseInt(i)]++;
  18. }
  19. for (let i = 0; i < arr.length; i++) while (arr[i]--) console.log(i);
  20. })();
  21.  
Success #stdin #stdout #stderr 0.07s 37260KB
stdin
10
5
2
3
1
4
2
3
5
1
7
stdout
1
1
2
2
3
3
4
5
5
7
stderr
(node:14450) ExperimentalWarning: readline Interface [Symbol.asyncIterator] is an experimental feature. This feature could change at any time
(node:14450) ExperimentalWarning: Readable[Symbol.asyncIterator] is an experimental feature. This feature could change at any time