public class Solution {
Dictionary<int, int> dic = new Dictionary<int, int>();
public IList<int> FindDuplicates(int[] nums)
{
var list = new List<int>();
foreach (var n in nums)
{
if (!dic.ContainsKey(n))
{
dic.Add(n, );
}
else
{
list.Add(n);
}
}
return list;
}
}

https://leetcode.com/problems/find-all-duplicates-in-an-array/#/description

leetcode442的更多相关文章

  1. [Swift]LeetCode442. 数组中重复的数据 | Find All Duplicates in an Array

    Given an array of integers, 1 ≤ a[i] ≤ n (n = size of array), some elements appear twice and others ...

  2. 2017-3-5 leetcode 442 531 533

    今天莫名其妙睡到了中午,很难受... leetcode442 https://leetcode.com/problems/find-all-duplicates-in-an-array/?tab=De ...

  3. ARTS第十三周(阅读Tomcat源码)

    1.Algorithm:每周至少做一个 leetcode 的算法题2.Review:阅读并点评至少一篇英文技术文章3.Tip:学习至少一个技术技巧4.Share:分享一篇有观点和思考的技术文章 考研真 ...

随机推荐

  1. 新的开源java反汇编程序Procyon

    wiki:https://bitbucket.org/mstrobel/procyon/wiki/Java%20Decompiler 由于jd好多年没更新了,今天找到这个新的开源反汇编,很不错 分享一 ...

  2. 【2018.06.26NOIP模拟】T2号码bachelor 【数位DP】*

    [2018.06.26NOIP模拟]T2号码bachelor 题目描述 Mike 正在在忙碌地发着各种各样的的短信.旁边的同学 Tom 注意到,Mike 发出短信的接收方手机号码似乎都满足着特别的性质 ...

  3. iOS Webview打开不受信的URL

    在我们开发过程中经常会碰到直接访问开发人员的私有地址, 这样在app 上是无法打开指定的网页的. 在iOS中需要对WKWebView 进行如下设置: 1.在工程的Plist 文件中添加一下选项 App ...

  4. 用Python做图像处理

    转自:http://blog.csdn.net/gzlaiyonghao/article/details/1852726  最近在做一件比较 evil 的事情——验证码识别,以此来学习一些新的技能.因 ...

  5. normalizr api 转换类库使用

    1. 项目初始化 yarn init yarn add normalizr 项目结构 app.js package.json user.json 2. 使用 a. app.js const userj ...

  6. MySQL的安装配置教程

    1. 官网下载ZIP压缩版本(本人电脑是64位的) x64bit MySQL Community 2. 解压到E:\SoftwareFiles\mysql-5.7.11-winx64 3. 在E:\S ...

  7. for, while的用法

    for循环求1+2+3+4+....+100 # include <stdio.h> int main(void) { int i; //循环中更新的变量i不能定义成浮点型 ; ; i&l ...

  8. Warning: skipping non-radio button in group. 的处理

    1)把你的第一个Radio选中group属性: 2)把你“这个组中”的最后一个Raido控件“后”的一个控件(指得是控件添加先后的顺序,可以用ctrl+d来修改顺序)也选中group属性,如最后一个R ...

  9. laravel里面的一些变量

    laravel5里面一些配置,比如数据库,debug的,实际上在项目的.env里面定义过了 //forge是默认值 'database' => env('DB_DATABASE', 'forge ...

  10. Oracle拆分字符串函数与执行调用

    本函数可以将“目标字符串”以“指定字符串”进行拆分,并通过表结构返回结果.代码如下: ); CREATE OR REPLACE FUNCTION splitstr(p_string IN VARCHA ...