Java 中的 List 和 Set 集合类型详解
a = [1,2,3,3]
list = list(set(a))a = {1,2,3,3}
b = {3,4,5}
#交集 {3}
a.intersection(b)
#并集 {1, 2, 3, 4, 5}
a.union(b)Last updated
Was this helpful?
a = [1,2,3,3]
list = list(set(a))a = {1,2,3,3}
b = {3,4,5}
#交集 {3}
a.intersection(b)
#并集 {1, 2, 3, 4, 5}
a.union(b)Last updated
Was this helpful?
Was this helpful?