LeetCode 217 Contains Duplicate 题解
1.题目:
Given an array of integers, find if the array contains any duplicates.
Your function should return true if any value appears at least twice in the array,
and it should return false if every element is distinct.
题意:
输入一个数组,如果有重复的数,输出true,没有的话输出false。
2.解题思路:
排序取中间
3.代码
1 |
|