
arr 순회k번째 요소가 존재하지 않다면, 빈 문자열("")을 반환하고 그렇지 않다면, k번째 요소 반환function kthDistinct(arr: string[], k: number): string {
const map = new Map()
for(const char of arr) {
map.set(char, (map.get(char) ?? 0) + 1)
}
const distincts = []
for(const [key, value] of map) {
if(value > 1) continue
distincts.push(key)
}
return distincts[k - 1] ?? ""
};