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 =========================================== ...
随机推荐
- java时间处理--持续时间格式化工具和常量类DurationFormatUtils
阅读目录 DurationFormatUtils类简介 maven地址 构造方法 DurationFormatUtils() formatDurationHMS(long durationMillis ...
- js操作链接url
使用js对当前的URL进行操作,可以使用内置对象window.location: window.location有以下属性: window.location.href:取得当前地址栏中的完整URL,可 ...
- python安装途中遇到的问题和解决方法
一.setuptools安装错误:RuntimeError: Compression requires the (missing) zlib module 1. 描述 搞了个腾讯云的服务器,闲在手上没 ...
- FastAdmin 开发第三天:认识目录
以下为标准 FastAdmin 安装后的目录 我们在运行命令时都是在这个目录. 我们所有的命令都在这个目录下面运行. 比如:安装前端组件,bower install 安装php 组件 composer ...
- python之 列表常用方法
更多列表的使用方法和API,请参考Python文档:http://docs.python.org/2/library/functions.html append:用于在列表末尾追加新对象: # app ...
- spring initializr 创建项目时,依赖对应的 artifactId
选择各个依赖时,对应的 artifactId 选择的依赖 artifactId名字 不选择依赖,默认包含的artifactId spring-boot-starter.spring-boot-star ...
- java 中的 hashcode
在Java的Object类中有一个方法: public native int hashCode(); 根据这个方法的声明可知,该方法返回一个int类型的数值,并且是本地方法,因此在Object类中并没 ...
- WinForm下ComboBox设定SelectedValue总结 (SelectedValue==null解决办法)[转]
http://www.cnblogs.com/qqflying/archive/2013/05/23/3096050.html 实践发现:以SelectedIndex赋值让ComboBox自动选中时能 ...
- 【数据库】mysql的安装
打开下载的mysql安装文件mysql-5.0.27-win32.zip,双击解压缩,运行“setup.exe”,出现如下界面 mysql安装向导启动,按“Next”继续 选择安装类型,有“Typic ...
- Linux基本操作命令及作用
文件和目录操作命令 命令 作用 cd change directory,切换目录 cp copy,其功能为复制文件或目录 find 用于查找目录或文件 mv move ,移动或重命名文件或目录 pwd ...