如题所述
æ å°ä¸ºæ°ç»åå¯ä»¥ç¸å ï¼å转æ¢åéåã
let a: Set<Int> = [1,2,3]
let b: Set<Int> = [4,5,6]
let c:[Int] = a.map { $0 } + b.map { $0 }
let d: Set<Int> = Set<Int>(c)
print(d)
å¦ä¸ç§æ¹æ³å°±æ¯å¾ªç¯æ第äºä¸ªéåçå ¨é¨å ç´ é½insertå°ç¬¬ä¸ä¸ªå»ï¼è¿ä¸ªåºè¯¥æ´å¿«ä¸äºã
let a: Set<Int> = [1,2,3]
let b: Set<Int> = [4,5,6]
let c:[Int] = a.map { $0 } + b.map { $0 }
let d: Set<Int> = Set<Int>(c)
print(d)
å¦ä¸ç§æ¹æ³å°±æ¯å¾ªç¯æ第äºä¸ªéåçå ¨é¨å ç´ é½insertå°ç¬¬ä¸ä¸ªå»ï¼è¿ä¸ªåºè¯¥æ´å¿«ä¸äºã
温馨提示:答案为网友推荐,仅供参考