input: Write a function to perform a truncated bubble sort on a list and return the sorted list along with the number of swaps needed.
  assert truncatedBubbleSort([7, 3, 5, 9]) == ([3, 5, 7, 9], 2)
  assert truncatedBubbleSort([4, 2, 7, 1, 3]) == ([2, 1, 3, 4, 7], 3)
  assert truncatedBubbleSort([10, 8, 6, 4, 2]) == ([8, 6, 4, 2, 10], 3)
  assert truncatedBubbleSort([1, 2, 3, 4, 5]) == ([1, 2, 3, 4, 5], 0)
output: def truncatedBubbleSort(lst):
      n = len(lst)
      swap_count = 0
      for i in range(n-1):
          for j in range(n-1-i):
              if lst[j] > lst[j+1]:
                  lst[j], lst[j+1] = lst[j+1], lst[j]
                  swap_count += 1
          if i == 1:
              break
      return lst, swap_count