def findContinuousIntervals(numbers):
    if not numbers:
        return []
sortedNumbers = sorted(numbers)
result = [(sortedNumbers[0], sortedNumbers[0])]
for n in sortedNumbers:
    a, b = result[-1]
if abs(b - n) <= 1:
    result[-1] = a, n
else:
    result.append((n, n))
return result
Кортежи замкнутых непрерывных интервалов