Closed RazvanBugoi closed 4 years ago
function findOdd(A) {
let obj = {};
A.forEach((el) => {
if(el in obj) obj[el] +=1;
else obj[el] = 1;
});
let value = Object.values(obj).filter((el) => el % 2 != 0);
return parseInt(Object.keys(obj).filter((el) => obj[el] == value));
}
https://www.codewars.com/kata/54da5a58ea159efa38000836/train/javascript