arr 중 단 1개만 있는 알파벳들 중 k번째 알파벳 반환하기, k번째가 없다면 "" 반환
Input: arr = ["d","b","c","b","c","a"], k = 2
Output: "a"
Input: arr = ["a","b","a"], k = 3
Output: ""
var kthDistinct = function(arr, k) {
let obj={}
let distinctArr=[]
for(let i in arr){
obj[arr[i]] ? obj[arr[i]] ++ : obj[arr[i]] = 1
}
for(let i in obj){
if(obj[i] == 1){
distinctArr.push(i)
}
}
return distinctArr[k-1] ? distinctArr[k-1] : ""
};
let obj={}
for(let i in arr){
obj[arr[i]] ? obj[arr[i]] ++ : obj[arr[i]] = 1
}
let distinctArr=[]
for(let i in obj){
if(obj[i] == 1){
distinctArr.push(i)
}
}
return distinctArr[k-1] ? distinctArr[k-1] : ""