input: Write a function to implement a linear search algorithm in Python for finding an item in a given array. The function should return the position of the item if found, otherwise it should return -1. If the input array is empty, the function should return -1.
  assert linearSearch('hospital', ['school', 'hospital', 'bookstore', 'mall', 'theatre'])==1
  assert linearSearch('mall', ['school', 'hospital', 'bookstore', 'mall', 'theatre'])==3
  assert linearSearch('park', ['school', 'hospital', 'bookstore', 'mall', 'theatre'])==-1
  assert linearSearch('theatre', ['school', 'hospital', 'bookstore', 'mall', 'theatre'])==4
  assert linearSearch('library', [])==-1
output: def linearSearch(item, arr):
      if not arr:
          return -1
      for i in range(len(arr)):
          if arr[i] == item:
              return i
      return -1