def find_max(arr,i):
  """
  Find the max element in a array
  """
  max = arr[0]
  max_index = 0

  for index in range(arr.shape[0]):
    if arr[index] > max:
      max = arr[index]
      max_index = index
  
  return max_index + i