Guest User

Untitled

a guest
Dec 17th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. const findOdd = (A) => {
  2. let count = {};
  3.  
  4. A.sort().forEach((i) => {
  5. count[i] = count[i] ? count[i] + 1 : 1;
  6. });
  7.  
  8. for(let key in count){
  9. if(count[key] % 2 !== 0) return Number(key);
  10. }
  11. }
Add Comment
Please, Sign In to add comment