single number ii, general version