input: Write a function that takes a list of integers as input and checks if there are three distinct elements in the list that sum to zero.
  assert triples_sum_to_zero([1, 3, 5, 0]) == False
  assert triples_sum_to_zero([1, 3, 5, -1]) == False
  assert triples_sum_to_zero([1, 3, -2, 1]) == True
  assert triples_sum_to_zero([1, 2, 3, 7]) == False
  assert triples_sum_to_zero([1, 2, 5, 7]) == False
  assert triples_sum_to_zero([2, 4, -5, 3, 9, 7]) == True
  assert triples_sum_to_zero([1]) == False
  assert triples_sum_to_zero([1, 3, 5, -100]) == False
  assert triples_sum_to_zero([100, 3, 5, -100]) == False
  
output: def triples_sum_to_zero(nums):
      nums.sort()
      n = len(nums)
      for i in range(n - 2):
          if i > 0 and nums[i] == nums[i - 1]:
              continue
          l, r = i + 1, n - 1
          while l < r:
              total = nums[i] + nums[l] + nums[r]
              if total == 0:
                  return True
              elif total < 0:
                  l += 1
              else:
                  r -= 1
      return False