input: Write a python function to find the position of a target element in a sorted array using binary search.
  assert findPosition([1, 2, 3, 4, 5], 3) == 2
  assert findPosition([10, 20, 30, 40, 50], 25) == -1
  assert findPosition([], 1) == -1
  assert findPosition([5, 10, 15, 20], 10) == 1
  assert findPosition([2, 4, 6, 8, 10], 8) == 3
output: def findPosition(arr, target):
      left, right = 0, arr.length - 1
      
      while left <= right:
          mid = left + (right - left) // 2
          if arr[mid] == target:
              return mid
          elif arr[mid] < target:
              left = mid + 1
          else:
              right = mid - 1
      
      return -1