[swift] 62. Set Intersection

RudinP·2023년 10월 26일
0

Study

목록 보기
89/227

Set Intersection

  • Set 간의 중복을 가져옴
let friendGroupA = ["철수", "영희", "멍멍", "야옹"]
let friendGroupB = ["철수", "영희", "짹짹", "우엉"]

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

let totalFriend = friendGroupASet.intersection(friendGroupBSet)
//["철수", "영희"]
profile
곰을 좋아합니다. <a href = "https://github.com/RudinP">github</a>

0개의 댓글