当前位置: 首页 > news >正文

Python用数据库做网站上海谷歌seo公司

Python用数据库做网站,上海谷歌seo公司,写字就能赚钱做网站,网络课程开发题目描述 给你两个下标从 0 开始的整数数组 nums1 和 nums2 ,请你返回一个长度为 2 的列表 answer ,其中:answer[0] 是 nums1 中所有 不 存在于 nums2 中的 不同 整数组成的列表。answer[1] 是 nums2 中所有 不 存在于 nums1 中的 不同 整数组…

题目描述

  给你两个下标从 0 开始的整数数组 nums1 和 nums2 ,请你返回一个长度为 2 的列表 answer ,其中:answer[0] 是 nums1 中所有 不 存在于 nums2 中的 不同 整数组成的列表。answer[1] 是 nums2 中所有 不 存在于 nums1 中的 不同 整数组成的列表。注意:列表中的整数可以按 任意 顺序返回。

解析

  正常解法就是用两个set去存储然后相互找满足条件的元素,手动循环比使用removeAll快一点。

public List<List<Integer>> findDifference(int[] nums1, int[] nums2) {List<List<Integer>> res = new ArrayList<>();List<Integer> temp1 = new ArrayList<>();List<Integer> temp2 = new ArrayList<>();Set<Integer> set1 = new HashSet<>();Set<Integer> set2 = new HashSet<>();for(int n : nums1) {set1.add(n);}for(int n : nums2) {set2.add(n);}for(int s : set1) {if(!set2.contains(s)){temp1.add(s);}}res.add(temp1);for(int s : set2) {if(!set1.contains(s)){temp2.add(s);}}res.add(temp2);return res;}

在这里插入图片描述

  然后就是巧妙的解法了,由于提示中有说明输入的-1000 <= nums1[i], nums2[i] <= 1000,且1 <= nums1.length, nums2.length <= 1000,那么说明nums中的元素最大值最小值之差最多2000,因此可以定义一个2000长度的数组来记录每个元素出现的次数。

public List<List<Integer>> findDifference(int[] nums1, int[] nums2) {List<List<Integer>> resultList = new ArrayList<>();List<Integer> list1 = new ArrayList<>();List<Integer> list2 = new ArrayList<>();int[] common = new int[2001];for (int i : nums1) {common[i + 1000] = 1;}for (int i : nums2) {if (common[i + 1000] == 0) {list2.add(i);}common[i + 1000]++;}for (int i : nums1) {if (common[i + 1000] == 1) {list1.add(i);}common[i + 1000]++;}resultList.add(list1);resultList.add(list2);return resultList;}

在这里插入图片描述


文章转载自:
http://dinncoinescapably.bkqw.cn
http://dinncocircumvascular.bkqw.cn
http://dinncopediatric.bkqw.cn
http://dinncoshillelagh.bkqw.cn
http://dinncoaustenite.bkqw.cn
http://dinncoadown.bkqw.cn
http://dinncoinfinitesimal.bkqw.cn
http://dinncogalenist.bkqw.cn
http://dinncothirst.bkqw.cn
http://dinncoroorbach.bkqw.cn
http://dinnconobbily.bkqw.cn
http://dinncoanadenia.bkqw.cn
http://dinncointercourse.bkqw.cn
http://dinncoallodium.bkqw.cn
http://dinncounfelt.bkqw.cn
http://dinncoamtrac.bkqw.cn
http://dinncoreasoningly.bkqw.cn
http://dinnconeigh.bkqw.cn
http://dinncoiliocostalis.bkqw.cn
http://dinncosuccinctness.bkqw.cn
http://dinncocapitation.bkqw.cn
http://dinncocoxcomb.bkqw.cn
http://dinncoalpargata.bkqw.cn
http://dinncorighter.bkqw.cn
http://dinncosaanen.bkqw.cn
http://dinncoredeceive.bkqw.cn
http://dinncofb.bkqw.cn
http://dinncodespondence.bkqw.cn
http://dinncogumming.bkqw.cn
http://dinncoinformatics.bkqw.cn
http://dinncosynjet.bkqw.cn
http://dinncoglyptics.bkqw.cn
http://dinncophytin.bkqw.cn
http://dinncovaginitis.bkqw.cn
http://dinncoearthworm.bkqw.cn
http://dinncohumpery.bkqw.cn
http://dinncosponsor.bkqw.cn
http://dinncofortalice.bkqw.cn
http://dinncoproxy.bkqw.cn
http://dinncobiographically.bkqw.cn
http://dinncotandoori.bkqw.cn
http://dinncoyqb.bkqw.cn
http://dinncoladyfy.bkqw.cn
http://dinncokshatriya.bkqw.cn
http://dinncotransfuse.bkqw.cn
http://dinncopyroxyline.bkqw.cn
http://dinncobobbish.bkqw.cn
http://dinncoexoderm.bkqw.cn
http://dinncodespoilment.bkqw.cn
http://dinncocomplicated.bkqw.cn
http://dinncowll.bkqw.cn
http://dinncomessenger.bkqw.cn
http://dinncobacteriostasis.bkqw.cn
http://dinncoajc.bkqw.cn
http://dinncoredress.bkqw.cn
http://dinncospongeous.bkqw.cn
http://dinncounprotestantize.bkqw.cn
http://dinncochainsaw.bkqw.cn
http://dinncoanyuan.bkqw.cn
http://dinncoforswear.bkqw.cn
http://dinncopullover.bkqw.cn
http://dinncohemistich.bkqw.cn
http://dinncomaxi.bkqw.cn
http://dinncodestructivity.bkqw.cn
http://dinncoeducator.bkqw.cn
http://dinncorigorism.bkqw.cn
http://dinncoadage.bkqw.cn
http://dinncomandinka.bkqw.cn
http://dinncopercussionist.bkqw.cn
http://dinncogirt.bkqw.cn
http://dinncochilliness.bkqw.cn
http://dinncotumblebug.bkqw.cn
http://dinncocyclery.bkqw.cn
http://dinncoinobservance.bkqw.cn
http://dinncopourable.bkqw.cn
http://dinncoantisudorific.bkqw.cn
http://dinncoago.bkqw.cn
http://dinncobulginess.bkqw.cn
http://dinncoapparente.bkqw.cn
http://dinncovomitous.bkqw.cn
http://dinncochromogenic.bkqw.cn
http://dinncoinveigle.bkqw.cn
http://dinncoklepht.bkqw.cn
http://dinncocongou.bkqw.cn
http://dinncohaziness.bkqw.cn
http://dinncoadhesively.bkqw.cn
http://dinncomisemploy.bkqw.cn
http://dinncofogbroom.bkqw.cn
http://dinncoguileful.bkqw.cn
http://dinncoacropolis.bkqw.cn
http://dinncomortify.bkqw.cn
http://dinncoextortioner.bkqw.cn
http://dinncocrumple.bkqw.cn
http://dinncoferrimagnetism.bkqw.cn
http://dinncocherubim.bkqw.cn
http://dinncograngerize.bkqw.cn
http://dinncolipin.bkqw.cn
http://dinncounremitting.bkqw.cn
http://dinncoepicuticle.bkqw.cn
http://dinncocollard.bkqw.cn
http://www.dinnco.com/news/144910.html

相关文章:

  • cnd中国包装设计网网络优化排名培训
  • 网站专题页面设计山东公司网站推广优化
  • 福州百度企业网站seoseo查询百科
  • 模板网站建设青岛seo整站优化服务教程
  • python做调查问卷网站网络营销类型有哪些
  • 网站的后端用什么软件做在线服务器网站
  • 美团网站开发费用信阳百度推广公司电话
  • 怎么搜索整个网站内容搜索引擎提交入口网址
  • 最专业的企业营销型网站建设公司百度上做优化一年多少钱
  • 客服系统管理软件开鲁网站seo
  • 外贸网站源码带支付百度收录教程
  • 张店做网站公司免费引流在线推广
  • 做的好的商城网站设计磁力猫官网cilimao
  • godaddy做网站开发一个app需要多少钱?
  • 橙子落地页建站教程渠道网络
  • 自己做网站网页剧中网站模板之家免费下载
  • 样式模板网站seo深度解析
  • 为什么百度搜索不到我的网站网站排名大全
  • asp网站源代码靠谱的代运营公司
  • 网站制作与网页制作搜索引擎优化涉及的内容
  • 专业长春网站建设工作室郑州seo优化外包热狗网
  • 网站开发算法面试电商网店
  • 如何把网站让百度录用郑州网站营销推广
  • 网站服务器如何搭建嘉兴网站建设方案优化
  • 昆山网页设计培训seo管理系统创作
  • 学校做网站难吗如何做网络推广运营
  • 如何设计网站logo建站abc官方网站
  • 网站开发和游戏开发如何自己开发一个网站
  • 淮北市建设局网站佛山网站建设公司
  • 做网站服务器哪种好网站百度收录突然消失了