[swift] 63. Set symmetricDifference

RudinP·2023년 10월 26일
0

Study

목록 보기
90/227

Set symmetricDifference

  • 중복이 되는 요소들을 제외하고 union 된 결과물을 리턴
let friendGroupA = ["철수", "영희", "멍멍", "야옹"]
let friendGroupB = ["철수", "영희", "짹짹", "우엉"]

let friendGroupASet = Set(friendGroupA)
let friendGroupBSet = Set(friendGroupB)

let totalFriend = friendGroupASet.symmetricDifference(friendGroupBSet)
//["멍멍", "야옹", "짹짹", "우엉"]
profile
곰을 좋아합니다. <a href = "https://github.com/RudinP">github</a>

0개의 댓글