IT General

Codility #6-Distinct

SoftArts 2018. 9. 30. 17:49
function solution(A) {
let set = new Set();

for (let i = 0, n = A.length; i < n; i++) {
set.add(A[i]);
}

return set.size;
}