public class Solution {
public int[] Intersection(int[] nums1, int[] nums2) {
var list1 = nums1.ToList();
var list2 = nums2.ToList();
var list = list1.Intersect(list2);
return list.ToArray<int>();
}
}

https://leetcode.com/problems/intersection-of-two-arrays/#/description

leetcode349的更多相关文章

  1. leetcode349 350 Intersection of Two Arrays & II

    """ Intersection of Two Arrays Given two arrays, write a function to compute their in ...

  2. [Swift]LeetCode349. 两个数组的交集 | Intersection of Two Arrays

    Given two arrays, write a function to compute their intersection. Example 1: Input: nums1 = [1,2,2,1 ...

  3. leetcode349—Intersection of Two Arrays

    Given two arrays, write a function to compute their intersection. Example 1: Input: nums1 = [1,2,2,1 ...

  4. [leetcode349]Intersection of Two Arrays

    设计的很烂的一道题 List<Integer> res = new ArrayList<>(); // int l1 = nums1.length; // int l2 = n ...

  5. LeetCode349. 两个数组的交集

    题目 给定两个数组,编写一个函数来计算它们的交集. 分析 数组元素值可以很大,所以不适合直接开数组进行哈希,这里要学习另一种哈希方式:集合 集合有三种,区别见下面代码随想录的Carl大佬的表格,总结的 ...

  6. LeetCode通关:哈希表六连,这个还真有点简单

    精品刷题路线参考: https://github.com/youngyangyang04/leetcode-master https://github.com/chefyuan/algorithm-b ...

随机推荐

  1. nyoj 魔法少女

    魔法少女 时间限制:1000 ms | 内存限制:65535 KB 难度:3 描述 前些时间虚渊玄的巨献小圆着实火了一把. 在黑长直(小炎)往上爬楼去对抗魔女之夜时,她遇到了一个问题想请你帮忙. 因为 ...

  2. zz 【见闻八卦】《金融时报》年度商业书单:互联网题材占一半

    [见闻八卦]<金融时报>年度商业书单:互联网题材占一半 文 / 见闻学堂 2014年12月18日 09:47:38 0   中国最好的金融求职培训:见闻学堂(微信号:top-elites) ...

  3. hadoop之 参数调优

    一. hdfs-site.xml 配置文件 1. dfs.blocksize 参数:hadoop文件块大小描述:新文件的默认块大小,以字节为单位,默认 134217728 字节.可以使用以下后缀(大小 ...

  4. virtualbox centos安装增强工具和问题详解

    virtualbox centos安装增强工具和问题详解 VirtualBox 大家都习惯性把它简称为 Vbox ,比 VM 的体积小.开源.速 度快.不过在使用 VirtualBox 在虚拟机中安装 ...

  5. 洛谷4059找爸爸(Code+第一次月赛)

    题目:https://www.luogu.org/problemnew/show/P4059 dp. 1.看出-A-B(k-1)可以理解成连续空格的第一个 -A,其余 -B: 2.把会干扰的“上一步右 ...

  6. dede模块管理一片空白或没有列表内容的解决办法

    为什么dede后台模块管理,打开之后一片空白,又或者没有列表,插件与其他模块的使用也是正常的. 这主要是因为我们在安装模块,然后又卸载模块,卸载的时候选择了删除安装文件,就会出这个问题. 这里面分为两 ...

  7. RegExp实例

    ECMAScript通过RegExp类型来支持正则表达式,常见的正则表达式为:var expression = /pattern / flags;其中的模式(pattern)部分可以使任何简单或复杂的 ...

  8. sikuli 安装

    1     简介 官方介绍: Sikuli脚本自动化,你在屏幕上看到的任何东西.它使用图像识别,识别和控制GUI组件.这是有用的,当有一个GUI的内部或源代码的访问是不容易的. Sikuli(在墨西哥 ...

  9. 【整理总结】代码沉淀 - CefSharp - 比较流行的第三方内嵌浏览器组件

    .NET (WPF and Windows Forms) bindings for the Chromium Embedded Framework web: https://github.com/ce ...

  10. [原]System.IO.Path.Combine 路径合并

    使用 ILSpy 工具查看了 System.IO.Path 类中的 Combine 方法 对它的功能有点不放心,原方法实现如下: // System.IO.Path /// <summary&g ...