PA3 Recursive
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.
        return self.helper(nums, perm, 0, 0, 0) # Invoking the helper method with count, i, and j being set default to 0

    def helper(self, nums, perm, count, i, j):
        if j >= len(perm): # Base case, making sure we are still within the bounds of perm, if not we are finished.
            return count
        if perm[j] > nums[i]: # If the condition is met we need to move on the the next index in nums
            return self.helper(nums, perm, count + 1, i + 1, j + 1)
        else:
            return self.helper(nums, perm, count, i, j + 1) # Otherwise we need to keep searching in perm for an index that meets the above condition
```
['Python']