javascript greedy
\nconst maxNumber = (a, b, k) => {\n    let m = a.length, n = b.length;\n    let res = [];\n    for (let i = Math.max(0, k - n); i <= Math.min(k, m); i++) {\n  
```\nconst maxNumber = (a, b, k) => {\n    let m = a.length, n = b.length;\n    let res = [];\n    for (let i = Math.max(0, k - n); i <= Math.min(k, m); i++) {\n        let maxA = maxArray(a, i), maxB = maxArray(b, k - i);\n        let merge = mergeArray(maxA, maxB);\n        if (merge > res) res = merge;\n    }\n    return res;\n};\n\nconst maxArray = (a, k) => {\n    let drop = a.length - k, res = [];\n    for (const x of a) {\n        while (drop > 0 && res.length && res[res.length - 1] < x) {\n            res.pop();\n            drop--;\n        }\n        res.push(x);\n    }\n    if (res.length >= k) {\n        res = res.slice(0, k);\n    } else {\n        res = res.concat(Array(k - res.length).fill(0));\n    }\n    return res;\n};\n\nconst mergeArray = (a, b) => {\n    let res = [];\n    while (a.length + b.length) res.push(a > b ? a.shift() : b.shift())\n    return res;\n};\n```
['Greedy', 'JavaScript']