Skip to content

Conversation

HighnessAtharva
Copy link
Contributor

Semantic update to the code so as to be up-to-date and running Python3. Previously, it followed Python2 standards and could not run on Python3.

Semantic update to the code so as to be up-to-date and running Python3. Previously, it followed Python2 standards and could not run on Python3.
Copy link
Owner

@arsho arsho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @HighnessAtharva ,
Thank you for updating this solution to Python 3. Please update your commit with this code files
However, I have improved the solution code as per your suggestion:

'''
Title     : Symmetric Difference
Subdomain : Sets
Domain    : Python
Author    : Ahmedur Rahman Shovon
Created   : 15 July 2016
Updated   : 15 March 2021
Problem   : https://www.hackerrank.com/challenges/symmetric-difference/problem
'''
m = int(input())
set_a = set(map(int, input().split()))
n = int(input())
set_b = set(map(int, input().split()))
set_a_diff = set_a.difference(set_b)
set_b_diff = set_b.difference(set_a)
for i in sorted(set_a_diff.union(set_b_diff)):
    print(i)

If you like this solution, update your commit with this code.

Updated Date added in comments. Code changed as per suggestion.
Copy link
Owner

@arsho arsho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the update. Cheers!

@arsho arsho merged commit 0db5d03 into arsho:master Mar 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants