Tag: 136 Single Number
-
LeetCode: 136 Single Number
•
Given a non-empty array of integers nums, every element appears twice except for one. Find that single one. Example: Input: nums = [2, 2, 1] Output: 1 Example: Input: nums = [4, 1, 2, 1, 2] Output: 4 Example: Input: nums = [1] Output: 1 问题 给定一个非空整数数组 nums,其中每个元素都出现两次,只有一个元素出现一次。找出那个只出现一次的元素。 解决方案 1…