LeetCode --- 961. N-Repeated Element in Size 2N Array 结题报告
Posted 杨鑫newlfe
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了LeetCode --- 961. N-Repeated Element in Size 2N Array 结题报告相关的知识,希望对你有一定的参考价值。
In a array nums
of size 2 * n
, there are n + 1
unique elements, and exactly one of these elements is repeated n
times.
Return the element repeated n
times.
Example 1:
Input: nums[1,2,3,3] Output: 3
Example 2:
Input: nums[2,1,2,5,3,2] Output: 2
Example 3:
Input: nums[5,1,5,2,5,3,5,4] Output: 5
Note:
4 <= nums.length <= 10000
0 <= nums[i] < 10000
nums.length
is even
所有代码均可在Github中找到:
# -*- coding:utf-8 -*-
__author__ = \'yangxin
以上是关于LeetCode --- 961. N-Repeated Element in Size 2N Array 结题报告的主要内容,如果未能解决你的问题,请参考以下文章
LeetCode 961. N-Repeated Element in Size 2N Array
LeetCode 961 在长度2N的数组中找出重复N次的元素[map] HERODING的LeetCode之路
Leetcode 961. N-Repeated Element in Size 2N Array