input: Write a function to optimize the given Python program that prints each element of a list on a new line. If the list is empty, print a message indicating there are no elements to print. Otherwise, use the optimized approach to print each element on a new line.
  assert optimize_printing([1, 2, 3, 4, 5, 6])==('1\n2\n3\n4\n5\n6')
  assert optimize_printing([])==('No elements to print')
  assert optimize_printing([10, 20, 30])==('10\n20\n30')
  assert optimize_printing([5])==('5')
  assert optimize_printing([7, 8, 9, 10])==('7\n8\n9\n10')
output: def optimize_printing(lst):
      if not lst:
          return 'No elements to print'
      return '\n'.join(map(str, lst))