Greedy💯💯👍🏻👍🏻
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```cpp []\nclass Solution {\npublic:\n    int largestSumAfterKNegations(vector<int>& nums, int k) {\n         sort(nums.begin(),nums.end());\n        int i=0;\n        while(i<nums.size()&&k>0){\n            if(nums[i]<0){\n                k--;\n                nums[i]*=-1;\n            }\n            i++;\n        }\n        if(k%2!=0){\n            sort(nums.begin(),nums.end());\n            nums[0]*=-1;\n        }\n        int sum=0;\n        for(int j=0;j<nums.size();j++){\n            sum+=nums[j];\n        }\n        return sum;\n    }\n};\n```
['C++']