File tree Expand file tree Collapse file tree 1 file changed +9
-17
lines changed
Expand file tree Collapse file tree 1 file changed +9
-17
lines changed Original file line number Diff line number Diff line change 44Domain : Python
55Author : Ahmedur Rahman Shovon
66Created : 15 July 2016
7+ Updated : 15 March 2021
78Problem : https://www.hackerrank.com/challenges/symmetric-difference/problem
89'''
9- # Enter your code here. Read input from STDIN. Print output to STDOUT
10- m = int (raw_input ())
11- set_a_str_ar = raw_input ().strip ().split ()
12- set_a_ar = list (map (int ,set_a_str_ar ))
13- n = int (raw_input ())
14- set_b_str_ar = raw_input ().strip ().split ()
15- set_b_ar = list (map (int ,set_b_str_ar ))
16-
17- set_a_set = set (set_a_ar )
18- set_b_set = set (set_b_ar )
19- set_a_dif_set = set_a_set .difference (set_b_set )
20- set_b_dif_set = set_b_set .difference (set_a_set )
21- res_set = set_a_dif_set .union (set_b_dif_set )
22- res_ar = list (res_set )
23- res_ar .sort ()
24- for i in res_ar :
25- print i
10+ m = int (input ())
11+ set_a = set (map (int , input ().split ()))
12+ n = int (input ())
13+ set_b = set (map (int , input ().split ()))
14+ set_a_diff = set_a .difference (set_b )
15+ set_b_diff = set_b .difference (set_a )
16+ for i in sorted (set_a_diff .union (set_b_diff )):
17+ print (i )
You can’t perform that action at this time.
0 commit comments