input: from typing import List, Any
  
  def linear_search(arr: List[Any], x: Any) -> int:
      """
      Perform an optimized linear search to find the index of an element in a list.
      If the element is not found, return -1.
  
      >>> linear_search([10, 20, 80, 30, 60, 50, 110, 100, 130, 170], 110)
      6
      >>> linear_search([10, 20, 80, 30, 60, 50, 110, 100, 130, 170], 175)
      -1
      """
      for index, item in enumerate(arr):
          if item == x:
              return index
      return -1
output:     for index, item in enumerate(arr):
          if item == x:
              return index
      return -1