uga/README.md

29 lines
742 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# uga
tjjt как дела
вываыв
ивавырлываы
def symmetric_difference(a: list, b: list) -> list:
set_a = set(a)
set_b = set(b)
result = set_a.symmetric_difference(set_b)
return sorted(result)
или
def symmetric_difference(a: list, b: list) -> list:
return sorted(set(a).symmetric_difference(set(b)))
# Тесты
assert symmetric_difference([1, 2, 3], [2, 3, 4]) == [1, 4]
assert symmetric_difference([1, 1, 2], [2, 2, 3]) == [1, 3]
assert symmetric_difference([], [1, 2]) == [1, 2]
assert symmetric_difference([1, 2], []) == [1, 2]
assert symmetric_difference([1, 1], [1, 1]) == []
assert symmetric_difference([5, 6, 7], [7, 8, 9]) == [5, 6, 8, 9]
print("Все тесты пройдены!")