input: def optimize_linear_search(arr: List[int], x: int) -> int:
      """ Optimize the given linear search function using best practices.
      The function should return the index of the first occurrence of the element x in the list arr.
      If the element is not found, it should return -1.
      >>> optimize_linear_search([2, 5, 7, 9, 11], 7)
      2
      >>> optimize_linear_search([2, 5, 7, 9, 11], 6)
      -1
      """
output:     for i in range(len(arr)):
          if arr[i] == x:
              return i
      return -1