Skip to content

Instantly share code, notes, and snippets.

@remi-bruguier
Created May 17, 2020 15:46
Show Gist options
  • Save remi-bruguier/3a3b70045f81085cb3e0fba944406f1f to your computer and use it in GitHub Desktop.
Save remi-bruguier/3a3b70045f81085cb3e0fba944406f1f to your computer and use it in GitHub Desktop.
Given a list of numbers, where every number shows up twice except for one number, find that one number.
const uniqueNumber = (arr:number[]):number => arr.reduce((x,y) => x^y);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment