input: Write a function to perform a linear search on a given array and return the index of the target value if found, or -1 if not found. If the array is empty, return -1.
  assert linearSearch([5, 3, 7, 2], 7)==2
  assert linearSearch([5, 3, 7, 2], 4)==-1
  assert linearSearch([1, 2, 3, 4, 5], 3)==2
  assert linearSearch([], 1)==-1
  assert linearSearch([10, 20, 30], 30)==2
output: def linearSearch(arr, target):
      if not arr:
          return -1
      for i in range(len(arr)):
          if arr[i] == target:
              return i
      return -1