Using math. You can sum the would be answer if all numbers were present. This is the sum of the set of nums * 3, say this is ps.
Then take the sum of nums, this is what you're given. say this is ss
divide the difference of the two sets by two which will give you the number with only one occurence.
(ps - ss) / 2 = number with only one occurence.
Add each number once and multiply the sum by 3, we will get thrice the sum of each element of the array. Store it as thrice_sum. Subtract the sum of the whole array from the thrice_sum and divide the result by 2. The number we get is the required number (which appears once in the array).
This assumes all positive integers are given in the array.