input: Write a python function to perform left rotation on an array by k elements.
  assert leftRotate([1, 2, 3, 4, 5], 2) == [3, 4, 5, 1, 2]
  assert leftRotate([10, 20, 30, 40, 50], 3) == [40, 50, 10, 20, 30]
  assert leftRotate([7, 8, 9, 1, 2], 1) == [8, 9, 1, 2, 7]
output: def leftRotate(arr, k):
      n = len(arr)
      k = k % n  # To handle cases where k is greater than array length
      return arr[k:] + arr[:k]