C++ solution || Beginner friendly || Using Priority queue
\nint n=a.size(),c=0;\n        priority_queue<int,vector<int>,greater<int>>pq;\n        for(int i=0;i<n;i++)\n            pq.push(a[i]);\n        while(k--)\n  
```\nint n=a.size(),c=0;\n        priority_queue<int,vector<int>,greater<int>>pq;\n        for(int i=0;i<n;i++)\n            pq.push(a[i]);\n        while(k--)\n        {\n            int p=pq.top();\n            pq.pop();\n            pq.push(-p);\n        }\n        while(!pq.empty())\n        {\n            c+=pq.top();\n            pq.pop();\n        }\n       return c; \n    }\n```\n``` If you like my approach then please upvote me.```
[]