Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save meet100ni/f482471c0d9285789e95d85c6471e564 to your computer and use it in GitHub Desktop.
Save meet100ni/f482471c0d9285789e95d85c6471e564 to your computer and use it in GitHub Desktop.
Set .symmetric_difference() Operation HackerRank Solution
# Enter your code here. Read input from STDIN. Print output to STDOUT
"""
For more understanding: https://www.programiz.com/python-programming/methods/set/symmetric_difference
"""
# '_' is a variable and input().split() will separate input from the console
_, a = input(), set(input().split())
_, b = input(), set(input().split())
print(len(a.symmetric_difference(b)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment