input: from typing import List
  
  def linear_search(arr: List[int], x: int) -> int:
      """ 
      Optimize the given linear search function using best practices. The optimized 
      function should use enumerate to iterate over the list and return the index of 
      the first occurrence of x. If x is not found, it should return -1.
  
      >>> linear_search([1, 2, 3, 4, 5], 3)
      2
      >>> linear_search([1, 2, 3, 4, 5], 6)
      -1
      """
output:     for i, value in enumerate(arr):
          if value == x:
              return i
      return -1