문제 링크 : Kth Distinct String in an Array
/**
* @param {string[]} arr
* @param {number} k
* @return {string}
*/
var kthDistinct = function(arr, k) {
const obj = {}
arr.forEach(el => obj[el] ? obj[el] += 1 : obj[el] = 1)
const filtered = arr.filter(e => obj[e] === 1)
return filtered.length >= k ? filtered[k-1] : ''
};