public class Solution {
public bool ContainsDuplicate(int[] nums) {
var list = nums.Distinct();
if (list.Count() == nums.Length)
{
return false;
}
else
{
return true;
}
}
}

https://leetcode.com/problems/contains-duplicate/#/description

leetcode217的更多相关文章

  1. leetcode-217存在重复元素

    leetcode-217存在重复元素 题意 给定一个整数数组,判断是否存在重复元素. 如果任何值在数组中出现至少两次,函数返回 true.如果数组中每个元素都不相同,则返回 false. 示例 1: ...

  2. [LeetCode217]Contains Duplicate

    题目:Given an array of integers, find if the array contains any duplicates. Your function should retur ...

  3. [Swift]LeetCode217. 存在重复元素 | Contains Duplicate

    Given an array of integers, find if the array contains any duplicates. Your function should return t ...

  4. 2017-3-11 leetcode 217 219 228

    ji那天好像是周六.....吃完饭意识到貌似今天要有比赛(有题解当然要做啦),跑回寝室发现周日才开始233333 =========================================== ...

随机推荐

  1. hello1与hello2的代码分析

    1.hello1代码分析 hello.java package javaeetutorial.hello1; import javax.enterprise.context.RequestScoped ...

  2. 剑指offer-青蛙变态跳台阶-全概率公式

  3. (研)for循环的一个bug以及3个while循环的快排

    在这个for循环中,只要有一次不满足,这个for循环将break掉 while(p->score>=90&&i<5) count++ //若有一次不满足的话,那么整个 ...

  4. stenciljs 学习十 服务器端渲染

      stenciljs提供了 ssr 支持,对于express 最简单的就是使用提供的中间件 express 集成 const express = require('express'); const ...

  5. linux平台下防火墙iptables原理

    iptables简单介绍 netfilter/iptables(简称为iptables)组成Linux平台下的包过滤防火墙,与大多数的Linux软件一样,这个包过滤防火墙是免费的,它能够取代昂贵的商业 ...

  6. 时间操作(JavaScript版)—页面显示格式:年月日 上午下午 时分秒 星期

    版权声明:本文为博主原创文章,未经博主同意不得转载. https://blog.csdn.net/wangshuxuncom/article/details/35222531 <!DOCTYPE ...

  7. PHP查找中文字符的解决方案

    在PHP中查找中文字符,有两种方案.1.中文字符是gbk(gb2312)有两种解决方法第一种:将PHP保存为ASCII编码,然后使用strpos查找,如:strpos($curl_res, ‘哈哈’) ...

  8. FineUI利用JS取控件的值

    用ExtJS的获取方式应该就可以了把...我是直接用Ext.getCmp("txt_cusname").getValue;不过txt_cusname这个控件如果是runat=&qu ...

  9. CF 1013E Hills——隔项转移的DP

    题目:http://codeforces.com/contest/1013/problem/E 设 dp[ i ][ j ][ 0/1 ] 表示前 i 个位置,有 j 个山峰,第 i 个位置不是/是山 ...

  10. hdu 6305 RMQ Similar Sequence——概率方面的思路+笛卡尔树

    题目:http://acm.hdu.edu.cn/showproblem.php?pid=6305 看题解,得知: 0~1内随机取实数,取到两个相同的数的概率是0,所以认为 b 序列是一个排列. 两个 ...