const fs = require('fs');
const stdin = (process.platform === 'linux'
? fs.readFileSync('/dev/stdin').toString()
:
`5 4
2 3 6 7 8
1 8 9 11`).split('\n');
const input = (() => {
let line = 0;
return () => stdin[line++];
})();
function solution(A, B){
let arrA = input().split(' ').map(v=>+v);
let arrB = input().split(' ').map(v=>+v);
console.log((arrA.concat(arrB)).sort((a, b) => a-b).join(' ')+' ')
}
let num = (input().split());
solution(...num)
구름은 표준 입출력 뿐 아니라 파일 입출력으로 해도 됩니다 !
개인적으로 이게 더 편하네요.
'코딩테스트 문제풀이' 카테고리의 다른 글
[프로그래머스, javascript] 이중우선순위큐 (1) | 2021.05.12 |
---|---|
[프로그래머스, javascript] 네트워크 (0) | 2021.05.11 |
[프로그래머스, javascript] 타겟 넘버 DFS와 BFS 풀이 (0) | 2021.04.06 |
[프로그래머스, javascript] 가장 긴 팰린드롬 (0) | 2021.03.28 |
[프로그래머스, javascript] 여행 경로 (0) | 2021.03.26 |