剑指 Offer 56 - I. 数组中数字出现的次数bahttps://leetcode.cn/problems/shu-zu-zhong-shu-zi-chu-xian-de-ci-shu-lcof/
| 2023-9-23
0  |  阅读时长 0 分钟
Date
Mar 30, 2023
need_review
need_review
type
剑指 Offer(第 2 版)
undo
undo
难度
中等
一个整型数组 nums 里除两个数字之外,其他数字都出现了两次。请写程序找出这两个只出现一次的数字。要求时间复杂度是O(n),空间复杂度是O(1)。
示例 1:
示例 2:
限制:
  • 2 <= nums.length <= 10000

 
  • Giscus
目录