@ericggg clever solution. If i appears in nums, add minus symbol to nums[i-1] as a kind of mark.