input: def optimized_linear_search(arr, x):
      """
      Optimize the linear search function to use the enumerate function.
      >>> optimized_linear_search([1, 2, 3, 4], 3)
      2
      >>> optimized_linear_search([1, 2, 3, 4], 5)
      -1
      """
output:     for i, value in enumerate(arr):
          if value == x:
              return i
      return -1