[swift] 62. Set Intersection

RudinP·2023년 10월 26일

Study

목록 보기
89/388

Set Intersection

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

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

let totalFriend = friendGroupASet.intersection(friendGroupBSet)
//["철수", "영희"]
profile
성장하기 위한 기록

0개의 댓글