function mergeHelper(arr, arr2) {
let result = [];
let i = 0;
let j = 0;
while (i < arr.length || j < arr2.length) {
if (arr[i] <= arr2[j] || j >= arr2.length) {
result.push(arr[i]);
i++;
} else if (arr[i] >= arr2[j] || i >= arr.length) {
result.push(arr2[j]);
j++;
}
}
return result;
}
while문을 합쳐보았습니다!
YEONGHUN KO
작성일
21.04.30 15:19
조회수
135
댓글 0