input: Write a function to find the largest three numbers in a given list. If the list has fewer than three numbers, return all the numbers in the list.
  assert largest_three_numbers([1, 6, 3, 8, 7, 4])==[6, 7, 8]
  assert largest_three_numbers([9, 3, 2])==[2, 3, 9]
  assert largest_three_numbers([5])==[5]
  assert largest_three_numbers([])==[]
  assert largest_three_numbers([10, 20, 30, 40])==[20, 30, 40]
output: def largest_three_numbers(nums):
      if len(nums) < 3:
          return sorted(nums)
      return sorted(nums)[-3:]