leetcode217
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的更多相关文章
- leetcode-217存在重复元素
leetcode-217存在重复元素 题意 给定一个整数数组,判断是否存在重复元素. 如果任何值在数组中出现至少两次,函数返回 true.如果数组中每个元素都不相同,则返回 false. 示例 1: ...
- [LeetCode217]Contains Duplicate
题目:Given an array of integers, find if the array contains any duplicates. Your function should retur ...
- [Swift]LeetCode217. 存在重复元素 | Contains Duplicate
Given an array of integers, find if the array contains any duplicates. Your function should return t ...
- 2017-3-11 leetcode 217 219 228
ji那天好像是周六.....吃完饭意识到貌似今天要有比赛(有题解当然要做啦),跑回寝室发现周日才开始233333 =========================================== ...
随机推荐
- 初次实践数据库--SQL Server2016
初学数据库使用 安装了SQL Server2016的开发者版本,本来以为就可以愉快地开始数据库的挖坑了,发现开出来之后除了创建数据库.选择数据库以外,并没有什么操作. 后来才发现还需要再安装SSMS( ...
- 开源泛域名服务xip.io部署试用
xip.io 是一个很方便的泛域名服务,类似的有一个xip.name 的开源实现 下载 go get github.com/peterhellberg/xip.name 启动 二进制包在GOPATH/ ...
- IBM WebSphere MQ介绍安装以及配置服务详解(转)
首先介绍一下MQ MQ消息队列的简称是一种应用程序对应用程序的通信方法.说白了也就是通过队列的方式来对应用程序进行数据通信.而无需专用链接来链接它们. MQ的通讯方式 1.数据报的方式 Datagra ...
- hybrid app 知识点
WebView能加载显示网页,可以将其视为一个浏览器. Android系统中,叫做 WebView ios系统中,新版是 WKWebView,旧版是 UIWebView Native App 和 We ...
- VS2010编译和运行项目错误
打开工程提示如下: The 'Microsoft.Data.Entity.Design.BootstrapPackage.BootstrapPackage, Microsoft.Data.Entity ...
- WinForm 窗体间参数传递
http://www.cnblogs.com/xinjian/archive/2011/09/15/2177851.html 本人刚刚接触Winform ,学习之后分享下心得. winform 窗体与 ...
- 虚拟机 VMware Tools 安装
Ubuntu 或具有图形用户界面的 Ubuntu Server 要挂载 CD 镜像并解压,请按以下步骤操作: 启动此虚拟机. 使用具有管理员权限或 root 用户权限的帐户登录此虚拟机. 选择:对于F ...
- springMVC学习(10)-上传图片
需求:在修改商品页面,添加上传商品图片功能. SpringMVC中对多部件类型解析: 1)springmvc中配置: <!-- 文件上传 --> <bean id="mul ...
- R语言学习——欧拉计划(1)Multiples of 3 and 5
[题目一]If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. ...
- [转]C#调用Excel VBA宏
[转载自]http://www.shangxueba.com/jingyan/95031.html 附上一段原创常用代码 计算列标题字符串 Function CalcColumn(ByVal c As ...