input: Write a python function to check if an array contains three consecutive duplicate elements.
  assert check_duplicate_in_array([1, 1, 1, 2, 3, 4, 5]) == True
  assert check_duplicate_in_array([1, 2, 3, 4, 5, 6, 7]) == False
  assert check_duplicate_in_array([7, 7, 7, 8, 9, 10]) == True
output: def check_duplicate_in_array(arr):
      for i in range(len(arr) - 2):
          if arr[i] == arr[i + 1] == arr[i + 2]:
              return True
      return False