Programmatic Approach || Implementation through Frequency Array ||
Intuition\nChecking the Constraints you have -100 <= nums[i] <= 100 values which sums upto 201. It gives me an idea of using a frequency Array rather than a STL
# Intuition\nChecking the Constraints you have `-100 <= nums[i] <= 100` values which sums upto 201. It gives me an idea of using a frequency Array rather than a `STL <MAP>`.\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\nFrequency Array stores numbers in sorted order which reduces the time complexity used by a `STL <MAP>` data structures. <br>\nBut to store negative numbers we have to tweak some constraints.\n\nConstraints when storing the frequencies are:\n1. `if(nums[i] < 0)` then store between `1 <= i <= 100` index by `abs(i)`\n2. `if(nums[i] > 0)` store between  `101 <= i <= 200` index by `100 + i`\n3. `if(nums[i] == 0)` store at `i = 0` {Corner Case}.\n\nBy using above approach you can easily fetch a frequency in O(1) constant time. \n\nNow we have to store the numbers with corresponding frequencies in an Data Structure so that we can make a `result` array.\n\nSo I ran a constant time loop from `0 to 200` and ignored the frequencies which are `0` and checked constraints accordingly.\n1. `if(i == 0)` then push the frequency of zero if exist. {Corner Case which is handled in above line t[i] == 0 }\n2. `1 <= i <= 100` then the `num` is negative then it should be inversed before pushing.\n3. `101 <=i <= 200` then the `num` is positive and it should be normalized by `100 - i` before pushing.\n\nThe LeetCode solution is Changing the input array inplace. \n\n# Complexity\n- Time complexity: O(N logN) for the `sort` function used\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n\n- Space complexity: O(N) for the `freq` pairs\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n\n# Code\n```\nclass Solution {\npublic:\n    static bool compare(pair<int,int>& a, pair<int,int>& b){\n        if(a.second == b.second) return a.first > b.first;\n        return a.second < b.second;\n    }\n    vector<int> frequencySort(vector<int>& nums) {\n        int n = nums.size();\n        int t[201];\n        memset(t, 0, sizeof(t));\n        for(int i = 0; i<n; i++){\n            if(nums[i] == 0) t[0]++;\n            \n            if(nums[i] < 0){\n                t[abs(nums[i])]++;\n            }\n            else if(nums[i] > 0){\n                t[100 + nums[i]]++;\n            }\n        }\n        vector<pair<int,int>> freq;\n        \n        for(int i = 0; i<=200; i++){\n            \n            if(t[i] == 0) continue;\n            \n            if(i == 0) freq.push_back({0, t[i]});\n            \n            if(t[i] > 0 && i <= 100 && i > 0){\n                freq.push_back({-i, t[i]});\n            }\n            \n            else if (i > 100){\n                freq.push_back({i - 100, t[i]});\n            }\n        }\n        sort(freq.begin(), freq.end(), compare);\n\n        vector<int> result;\n        for(auto& [num, fr]: freq){\n            while(fr--){\n                result.emplace_back(num);\n            }\n        }\n        return result;\n    }\n};\n```
['Array', 'Sorting', 'C++']