input: Write a python function to sort an array by moving all negative numbers to the end while preserving the order of positives and negatives.
  assert sort_positives_negatives([-5, 2, 7, -3, 4, 9])==[2, 7, 4, 9, -5, -3]
  assert sort_positives_negatives([1, -2, -3, 4, 5, -6])==[1, 4, 5, -2, -3, -6]
  assert sort_positives_negatives([-1, -2, -3, -4])==[-1, -2, -3, -4]
  assert sort_positives_negatives([1, 2, 3, 4])==[1, 2, 3, 4]
output: def sort_positives_negatives(arr):
      positives = [x for x in arr if x >= 0]
      negatives = [x for x in arr if x < 0]
      return positives + negatives