Skip to content

Instantly share code, notes, and snippets.

@spreered
Created September 13, 2017 08:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spreered/96e942a7c36290939fa4f6e771ba3d6a to your computer and use it in GitHub Desktop.
Save spreered/96e942a7c36290939fa4f6e771ba3d6a to your computer and use it in GitHub Desktop.
def single_number(nums)
nums.sort!
i=0
while i< nums.length
if( nums[i]== nums[i+1] )
i=i+2
else
return nums[i]
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment