-
-
Save spreered/483bbb123858525c0d5cc6b7eeebf21f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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