Skip to content

Instantly share code, notes, and snippets.

@spreered
Last active September 13, 2017 08:44
Show Gist options
  • Save spreered/483bbb123858525c0d5cc6b7eeebf21f to your computer and use it in GitHub Desktop.
Save spreered/483bbb123858525c0d5cc6b7eeebf21f 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