input: Write a python function to count the elements in an array until a -1 is encountered.
  assert countElements([1, 2, 3, -1, 5, 6]) == 3
  assert countElements([10, 20, 30, -1, 40, 50]) == 3
  assert countElements([5, 7, 9, -1, 6, 4, 3]) == 3
output: def countElements(arr):
      count = 0
      for num in arr:
          if num == -1:
              break
          count += 1
      return count