✅🔥EASY and FAST solution🔥✅||O(nlogn) TIME - O(n) SPACE||🚀
\n# Complexity\n- Time complexity:\nO(nlogn)\n\n- Space complexity:\nO(n)\n\n# Code\n\nvar miceAndCheese = function(reward1, reward2, k) {\n    let arr=[];\n   
\n# Complexity\n- Time complexity:\n$$O(nlogn)$$\n\n- Space complexity:\n$$O(n)$$\n\n# Code\n```\nvar miceAndCheese = function(reward1, reward2, k) {\n    let arr=[];\n    for(let i=0;i<reward1.length;i++){\n        let x=reward1[i]-reward2[i];\n        arr.push([x,i]);\n    }\n    arr.sort((a,b)=>b[0]-a[0]);\n    let res=0;\n    for(let i=0;i<reward1.length;i++){\n        if(i<k) res+=reward1[arr[i][1]];\n        else res+=reward2[arr[i][1]];    \n    }\n    return res;\n    \n};\n```
['Array', 'Sorting', 'JavaScript']