input: def top_k_elements(arr, k):
      """
      Given an array of integers and a positive integer k, return a sorted list 
      containing the k largest elements in the array.
  
      Example 1:
  
          Input: arr = [-3, -4, 5], k = 3
          Output: [-4, -3, 5]
  
      Example 2:
  
          Input: arr = [4, -4, 4], k = 2
          Output: [4, 4]
  
      Example 3:
  
          Input: arr = [-3, 2, 1, 2, -1, -2, 1], k = 1
          Output: [2]
  
      Constraints:
          1. The array length will be between 1 and 1000 inclusive.
          2. Array elements will range from -1000 to 1000 inclusive.
          3. 0 <= k <= len(arr)
      """
output:     if k == 0:
          return []
      return sorted(sorted(arr)[-k:])