PA3
IntuitionApproachComplexity
Time complexity:

Space complexity:
Code
# Intuition
<!-- Describe your first thoughts on how to solve this problem. -->

# Approach
<!-- Describe your approach to solving the problem. -->

# Complexity
- Time complexity:
<!-- Add your time complexity here, e.g. $$O(n)$$ -->

- Space complexity:
<!-- Add your space complexity here, e.g. $$O(n)$$ -->

# Code
```python []
class Solution(object):
    def maximizeGreatness(self, nums):
        nums, perm = sorted(nums), sorted(nums) # Sorting nums and perm in ascending order.
        count, i = 0, 0 # Our greatness counter and pointer for nums.
        for j in range(len(nums)): # Looping through nums with the pointer for perm.
            if perm[j] > nums[i]: # If the current element at perm is larger incremement count and nums pointer. This also means perm[j] is the smallest element greater than nums[i].
                count, i = count + 1, i + 1 # Incrementing
        return count # Returning the greatness counter.
```
['Python']