Set .union() Operation
-
Practice>Python>Sets>Set .union() Operationhackerrank.com 2019. 2. 26. 12:52
hackerrank.comSet .union() OperationProblem link : https://www.hackerrank.com/challenges/py-set-union/problemDifficulty : Easy TipIf you understand how set() is used, it's simple questionDon't forget to split string to each item for set() Solution input() s = input() s1 = set(s.split(" ")) input() s = input() s2 = set(s.split(" ")) su = s1.union(s2) print(len(su))