// you can write to stdout for debugging purposes, e.g.
// console.log('this is a debug message');
function solution(A) {
// write your code in JavaScript (Node.js 8.9.4)
let values = new Set();
for(let i in A){
values.add(A[i]);
}
return values.size;
}
// you can write to stdout for debugging purposes, e.g.
// console.log('this is a debug message');
function solution(A) {
// write your code in JavaScript (Node.js 8.9.4)
let count = Array(Math.max(...A)).fill(0);
for(let a of A){
count[a]++;
}
return count.findIndex(1);
}
# you can write to stdout for debugging purposes, e.g.
# print("this is a debug message")
def solution(A):
# write your code in Python 3.6
list = set(A)
return len(list)