input: 
  def largest_elements(nums, n):
      """
      Given a list 'nums' of integers and a positive integer 'n', return a sorted list 
      containing 'n' largest elements from 'nums'.
  
      Example 1:
  
          Input: nums = [-3, -4, 5], n = 3
          Output: [-4, -3, 5]
  
      Example 2:
  
          Input: nums = [4, -4, 4], n = 2
          Output: [4, 4]
  
      Example 3:
  
          Input: nums = [-3, 2, 1, 2, -1, -2, 1], n = 1
          Output: [2]
  
      Note:
          1. The size of the list will be between [1, 1000].
          2. The values in the list will be between [-1000, 1000].
          3. 0 <= n <= len(nums)
      """
  
output:     return sorted(sorted(nums, reverse=True)[:n])