title: Given a non-empty array of integers nums, every element appears twice except for one. Find that single one
body: <pre><code>nums.sort()
  i = 0
  for i in range(len(nums)-1):
      if nums[i] == nums[i+1]:
          i = i + 2
      else: 
          return nums[i]
  </code></pre>
  <p>Could someone please explain why this code doesn't work? The logic is whenever I find a duplicate, I will jump two numbers ahead and compare that number to the one after.</p>
  <p>Thank you.</p>