input: def optimize_linear_search(arr, x) -> int:
      """ Optimize the given linear search function using best practices.
      >>> optimize_linear_search([1, 2, 3, 4, 5], 3)
      2
      >>> optimize_linear_search([1, 2, 3, 4, 5], 6)
      -1
      """
output:     for i, value in enumerate(arr):
          if value == x:
              return i
      return -1