JSFiddle - React, Tailwind, and code Playground

by hescano

JavaScript

function findOdd(A) {
  return A.filter((n) => A.filter((a)=> a === n).length % 2 === 1)[0]
}

console.log(findOdd([20,1,-1,2,-2,3,3,5,5,1,2,4,20,4,-1,-2,5]));