Two pointer || Brute force (TLE)|| C++
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## Two pointer approach!!\n# Code\n```\nclass Solution {\npublic:\n    int maximizeGreatness(vector<int>& nums) {\n        sort(nums.begin(),nums.end());\n        int count=0;\n        int i=0;\n        int j=0;\n        while(j<nums.size())\n        {\n            if(nums[i] >= nums[j]) j++;\n            else if(nums[i] < nums[j]){\n                count++;\n                i++;\n                j++;\n            }\n        } \n        return count;\n    }\n};\n\n#Brute force(TLE)\nclass Solution {\npublic:\n    int maximizeGreatness(vector<int>& nums) {\n        sort(nums.begin(),nums.end());\n        int count=0;\n        for(int i=0;i<nums.size();i++){\n            for(int j=i;j<nums.size();j++){\n                if(nums[j]>0){\n                if(nums[j]>abs(nums[i])){\n                    count++;\n                    nums[j]=-nums[j];\n                    break;\n                }\n             }\n          }\n        }\n        return count;\n    }\n};\n```
['C++']