Temukan int ganjil
return arr.find((item) => arr.filter(el => el === item).length % 2);
Careful Camel
return arr.find((item) => arr.filter(el => el === item).length % 2);
function findOdd(A) {
let object ={}
for(let i= 0; i<A.length;i++){
if(object[A[i]]){
object[A[i]]++;
}else{
object[A[i]] =1;
}
}
for(let key in object){
if(object[key] %2 !==0){
return Number(key)
}
}
}