"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.mergeSort = void 0;
function mergeSort(a, b) {
    let i = 0;
    let j = 0;
    const merge = [];
    while (i < a.length || j < b.length) {
        if (i < a.length && j < b.length) {
            if (a[i] < b[j]) {
                merge.push(a[i]);
                i++;
            }
            else {
                merge.push(b[j]);
                j++;
            }
        }
        else if (i < a.length) {
            merge.push(a[i]);
            i++;
        }
        else if (j < b.length) {
            merge.push(b[j]);
            j++;
        }
    }
    return merge;
}
exports.mergeSort = mergeSort;
//# sourceMappingURL=mergeSort.js.map