Very Easy || Easy to understand
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\nPriority Queue\nstep 1: Push array elemnt in queue(max heap)\nstep 2: mov
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\nPriority Queue\nstep 1: Push array elemnt in queue(max heap)\nstep 2: move queue element in ans array\nstep 3: Now reverse the ans array\n\n# Complexity\n- Time complexity:O(nlogn)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->O(n)\n\n# Code\n```\nclass Solution {\npublic:\n    vector<int> sortArray(vector<int>& nums) {\n        priority_queue<int>q;\n        for(auto x : nums){\n            q.push(x);\n        }\n        int n = nums.size();\n        vector<int>ans;\n        while(!q.empty()){\n            ans.push_back(q.top());\n            q.pop();\n        }\n        reverse(ans.begin(),ans.end());\n        return ans;\n    }\n};\n```
['C++']