JavaScript Solution: 5 steps
Don\'t think too much\nAs the question tell us need to stay the same order, we can\'t use some magic way to solve it.\nTherefore:\n#### step 1: Save original in
# Don\'t think too much\nAs the question tell us need to stay the same order, we can\'t use some magic way to solve it.\nTherefore:\n#### step 1: Save original index\n#### step 2: Sort it by its value\n#### step 3: Slice k elements\n#### step 4: Make it up by its index order\n#### step 5: Filter empty elements\n\nThen you get it.\n\n```\n/**\n * @param {number[]} nums\n * @param {number} k\n * @return {number[]}\n */\nvar maxSubsequence = function(nums, k) {\n    nums = nums.map((n,i) => [i, n])\n    \n    nums.sort((a,b) => b[1] - a[1])\n\t\n    let arr = nums.slice(0, k)\n    let res = []\n    \n    for(let i of arr) {\n        res[i[0]] = i[1]\n    }\n    \n    return res.filter(i=>i !== undefined)\n};\n```
['JavaScript']