📅  最后修改于: 2022-03-11 15:02:54.077000             🧑  作者: Mango
function findOdd(A) {
let counts = A.reduce((p, n) => (p[n] = ++p[n] || 1, p), {});
return +Object.keys(counts).find(k => counts[k] % 2) || undefined;
}