(Original post) https://qiita.com/suzu12/items/af0ccbca88f33dec2fda #Practice https://qiita.com/suzu12/items/af0ccbca88f33dec2fda
Duplicate elements are extracted from the list in Python, and the list in the list is subtracted in Python. I feel like it will be shorter. Please tell me.
https://live.sympy.org/
sum( [i for i in [1,2,3] if i not in [x for x in set([1,2,3]) if [1,2,3].count(x) > 1]]) 6 sum( [i for i in [3,2,3] if i not in [x for x in set([3,2,3]) if [3,2,3].count(x) > 1]]) 2 sum( [i for i in [3,3,3] if i not in [x for x in set([3,3,3]) if [3,3,3].count(x) > 1]]) 0