For this Question: Toros went to the supermarket to buy K items. There were a total of N items. Each item had a distinct price P<sub>i</sub>. He is cost-effective, so he would buy the K cheapest item. But he knows that the more cheaper an item is, the more is the chances that it can be defective. So he planned to ignore 2 cheapest items and buy K from the remaining ones.
Find the total cost of all items that he would buy.The first line contains two integers N and K, denoting the total number of items in the supermarket and the number of items Toros is going to buy.
The second line contains N distinct integers P<sub>i</sub> , denoting the prices of the items

<b>Constraints:</b>
1 <= N <= 100000
1 <= K <= N - 2
1 <= P<sub>i</sub> <= 1000000Print a single integer denoting the total cost of items Toros would buy.Sample Input:
5 2
4 1 2 3 5

Sample Output:
7

Explanation:
Toros will ignore items with price 1 and 2 and would buy items with price 4 and 3.

Sample Input:
10 8
99 56 50 93 47 36 65 25 87 16

Sample Output:
533, I have written this Solution Code: function supermarket(prices, n, k) {
        // write code here
        // do not console.log the answer
        // return sorted array
        const newPrices = prices.sort((a, b) => a - b).slice(2)

        let kk = k
        let price = 0;
        let  i = 0
        while (kk-- && i < newPrices.length) {
            price += newPrices[i]
            i += 1
        }
        return price
    }, In this Programming Language: JavaScript, Now tell me if this Code is compilable or not?