题目链接

集合操作

附上代码:

 M = int(input())
m = set(map(int, raw_input().strip().split()))
N = int(input())
n = set(map(int, raw_input().strip().split()))
tmp = sorted(m.union(n).difference(m.intersection(n)))
for i in xrange(len(tmp)):
print tmp[i]

hackerrank---Sets - Symmetric Difference的更多相关文章

  1. FCC高级编程篇之Symmetric Difference

    Symmetric Difference Create a function that takes two or more arrays and returns an array of the sym ...

  2. js-FCC算法-Symmetric Difference

    创建一个函数,接受两个或多个数组,返回所给数组的 对等差分(symmetric difference) (△ or ⊕)数组. 给出两个集合 (如集合 A = {1, 2, 3} 和集合 B = {2 ...

  3. FCC(ES6写法) Symmetric Difference

    创建一个函数,接受两个或多个数组,返回所给数组的 对等差分(symmetric difference) (△ or ⊕)数组. 给出两个集合 (如集合 A = {1, 2, 3} 和集合 B = {2 ...

  4. [Advanced Algorithm] - Symmetric Difference

    题目 创建一个函数,接受两个或多个数组,返回所给数组的 对等差分(symmetric difference) (△ or ⊕)数组. 给出两个集合 (如集合 A = {1, 2, 3}和集合 B = ...

  5. Symmetric Difference FreeCodeCamp

    function sym(args) { var arr = Array.prototype.slice.call(arguments); return arr.reduce((arr1, arr2) ...

  6. Symmetric Difference

    function sym(args) { //return args; var arr = []; for(var i = 0; i < arguments.length; i++){ arr. ...

  7. python3 第十五章 - 数据类型之Sets(集合)

    python的官网里对集合的描述是: Python also includes a data type for sets. A set is an unordered collection with ...

  8. Symmetric Difference-freecodecamp算法题目

    Symmetric Difference 1.要求 创建一个函数,接受两个或多个数组,返回所给数组的对等差分(symmetric difference) 例子:给出两个集合 (如集合 A = {1, ...

  9. Python高手之路【三】python基础之函数

    基本数据类型补充: set 是一个无序且不重复的元素集合 class set(object): """ set() -> new empty set object ...

随机推荐

  1. DLINK 企业路由器内网部署web开启端口转发后还需要开启是否支持端口回流功能

    跑后台使用的服务器,配置一般都很低,带宽只有2Mb 一些大型文件比如app的更新包使用这种服务器不可行 但是公司的网络是100Mb对等静态ip专线 所以能利用起来,每年将会省下8万块 说干就干,这个步 ...

  2. Linux Shell脚本经典案例

    开头加解释器:#!/bin/bash    语法缩进,使用四个空格:多加注释说明.    命名建议规则:变量名大写.局部变量小写,函数名小写,名字体现出实际作用.    默认变量是全局的,在函数中变量 ...

  3. Python中函数的定义必须在调用的前面

    # -*- coding:utf-8 -*- Python中函数的定义必须在调用的前面,但是在函数的内部调用一个函数,不用考虑顺序,只要被调用的函数被定义了即可 #标准的先函数定义,后函数调用def ...

  4. java时间戳和PHP时间戳的转换问题

    由于精度不同,导致长度不一致,直接转换错误.  JAVA时间戳长度是13位,PHP时间戳长度是10位.主要最后三位的不同. 方法,截取前10位,substr($time,0,10);

  5. 【noip】跟着洛谷刷noip题2

    noip好难呀. 上一个感觉有点长了,重开一个. 36.Vigenère 密码 粘个Openjudge上的代码 #include<cstdio> #include<iostream& ...

  6. 彻底删除 Git 项目中的文件(BFG Repo-Cleaner 用法)

    一些时候由于开发初期经验不足和贪图方便, 会把一些不应该提交到 Git 的文件上传到 Github, 带来一系列安全问题, 更有可能是把一些大文件上传到 GitHub 上, 导致项目非常臃肿, 每次 ...

  7. C# WPF 如何禁止窗口拖到屏幕边缘自动最大化

    win7以上的系统新增了功能--窗口拖到屏幕边缘自动最大化

  8. 为什么打不开IDEA或webStorm官方网页?

    为什么打不开IDEA或webStorm官方网页? 一.问题描述 idea和webStorm的官网:https://www.jetbrains.com/ 有时候打开idea的官网会出现无法访问的情况,页 ...

  9. windows 环境下搭建docker私有仓库

    windows 环境下搭建docker私有仓库 1.在公用仓库中pull仓库镜像 docker pull regitry 2.启动仓库镜像 //-d意思是后台运行,-p是做端口映射,这里是将本地的50 ...

  10. 2018-11-1-WPF-Main-thread-gets-a-deadlock-when-stylus-input-thread-is-waiting-for-the-window-to-clos...

    title author date CreateTime categories WPF Main thread gets a deadlock when stylus input thread is ...