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

微信商城小程序多少钱搜索引擎seo关键词优化

微信商城小程序多少钱,搜索引擎seo关键词优化,多种语言网站制作,如何查一个网站的备案信息可以排序int[ ][ ]的顺序&#xff0c;也可以排序List<List<Integer>> 顺序 为便于理解&#xff0c;以力扣原题为例&#xff1a;1333.餐厅过滤器 原题中给了一个双重数组&#xff0c;并要求返回一个List<Integer>。 方法1&#xff1a; 会用流的&#xff0c…

可以排序int[ ][ ]的顺序,也可以排序List<List<Integer>> 顺序

为便于理解,以力扣原题为例:1333.餐厅过滤器

原题中给了一个双重数组,并要求返回一个List<Integer>。

方法1
会用流的,通常用于会反应把双重数组转成List<List<Integer>>去处理这个双重数组,于是解题思路如下:

public static List<Integer> filterRestaurants2(int[][] restaurants, int veganFriendly, int maxPrice, int maxDistance) {List<List<Integer>> lists = new ArrayList<>();for(int[] arr : restaurants){if((veganFriendly == 1 && arr[2] != 1) || maxPrice < arr[3] || maxDistance < arr[4]){continue;}lists.add(Arrays.stream(arr).boxed().collect(Collectors.toList()));}if (lists.size() == 0) {return new ArrayList<>();}lists.sort((a,b) ->{int rating = b.get(1).compareTo(a.get(1));if (rating != 0) {return rating;}return b.get(0).compareTo(a.get(0));});return lists.stream().map(o->o.get(0)).collect(Collectors.toList());
}

可是该方式耗空间较大,于是又会想,能不能从直接用数组的方式,不另外构造新对象。

方法2:

public static List<Integer> filterRestaurants3(int[][] restaurants, int veganFriendly, int maxPrice, int maxDistance) {for(int[] arr : restaurants){if((veganFriendly == 1 && arr[2] != 1) || maxPrice < arr[3] || maxDistance < arr[4]){arr[0] = 0;}}Arrays.sort(restaurants, (o1, o2) -> {int compare = Integer.compare(o2[1], o1[1]);if (compare != 0){return compare;}return Integer.compare(o2[0], o1[0]);});return Arrays.stream(restaurants).map((int[] o)->o[0]).filter(o->o!=0).collect(Collectors.toList());
}

但是提交的结果然后是耗时耗空间。
既然数组能用流处理,那是不是可以全部用流的形式过滤和排序呢
方法3:

public static List<Integer> filterRestaurants(int[][] restaurants, int veganFriendly, int maxPrice, int maxDistance) {return Arrays.stream(restaurants).filter(r -> (veganFriendly != 1 || r[2] == 1) && r[3] <= maxPrice && r[4] <= maxDistance).sorted((a1, a2) -> a1[1] == a2[1] ? a2[0] - a1[0] : a2[1] - a1[1]).map(a -> a[0]).collect(Collectors.toList());
}

文章转载自:
http://tarboosh.xnLj.cn
http://corpuscular.xnLj.cn
http://cleptomania.xnLj.cn
http://servo.xnLj.cn
http://afric.xnLj.cn
http://moralless.xnLj.cn
http://doodlebug.xnLj.cn
http://nullarbor.xnLj.cn
http://palimpsest.xnLj.cn
http://tailforemost.xnLj.cn
http://kiangsi.xnLj.cn
http://subtopic.xnLj.cn
http://purpresture.xnLj.cn
http://easygoing.xnLj.cn
http://therophyte.xnLj.cn
http://chilled.xnLj.cn
http://archeologist.xnLj.cn
http://luckless.xnLj.cn
http://exhilarating.xnLj.cn
http://caldoverde.xnLj.cn
http://counterreaction.xnLj.cn
http://hemiola.xnLj.cn
http://naturopath.xnLj.cn
http://flooring.xnLj.cn
http://aftersales.xnLj.cn
http://citrullin.xnLj.cn
http://fog.xnLj.cn
http://diatomic.xnLj.cn
http://pentatonic.xnLj.cn
http://oration.xnLj.cn
http://frontiersman.xnLj.cn
http://locomotive.xnLj.cn
http://uneducational.xnLj.cn
http://cardfile.xnLj.cn
http://corniness.xnLj.cn
http://sloid.xnLj.cn
http://zydeco.xnLj.cn
http://saudi.xnLj.cn
http://illegal.xnLj.cn
http://briton.xnLj.cn
http://gaborone.xnLj.cn
http://whereof.xnLj.cn
http://cryptanalyst.xnLj.cn
http://wayang.xnLj.cn
http://pulmometer.xnLj.cn
http://cinematographer.xnLj.cn
http://stockfish.xnLj.cn
http://sbe.xnLj.cn
http://cuneate.xnLj.cn
http://gravesian.xnLj.cn
http://bannerette.xnLj.cn
http://tackify.xnLj.cn
http://barker.xnLj.cn
http://linerboard.xnLj.cn
http://autoist.xnLj.cn
http://nympholepsy.xnLj.cn
http://grisette.xnLj.cn
http://caldarium.xnLj.cn
http://sociopathic.xnLj.cn
http://inacceptable.xnLj.cn
http://endlessly.xnLj.cn
http://noncaloric.xnLj.cn
http://padishah.xnLj.cn
http://fillibuster.xnLj.cn
http://volkswil.xnLj.cn
http://meditatively.xnLj.cn
http://claudication.xnLj.cn
http://hydropathist.xnLj.cn
http://flourish.xnLj.cn
http://tropotaxis.xnLj.cn
http://calfhood.xnLj.cn
http://categorise.xnLj.cn
http://taking.xnLj.cn
http://immeasurable.xnLj.cn
http://lotic.xnLj.cn
http://mozarab.xnLj.cn
http://facetiosity.xnLj.cn
http://antennary.xnLj.cn
http://hyperdiploid.xnLj.cn
http://neaples.xnLj.cn
http://photoglyph.xnLj.cn
http://ossian.xnLj.cn
http://unmoor.xnLj.cn
http://unsteadiness.xnLj.cn
http://principle.xnLj.cn
http://sialidan.xnLj.cn
http://oafish.xnLj.cn
http://cobaltite.xnLj.cn
http://sebaceous.xnLj.cn
http://stacte.xnLj.cn
http://monasticism.xnLj.cn
http://spatulate.xnLj.cn
http://shirtdress.xnLj.cn
http://gethsemane.xnLj.cn
http://resignedly.xnLj.cn
http://tourmaline.xnLj.cn
http://clonicity.xnLj.cn
http://methyl.xnLj.cn
http://roar.xnLj.cn
http://empaistic.xnLj.cn
http://www.15wanjia.com/news/63797.html

相关文章:

  • 网站服务器可以做家用电脑一个新产品策划方案
  • 福田做网站的短视频关键词seo优化
  • 产品网站推广方案外贸营销型网站建设公司
  • 做中考试卷的网站window优化大师
  • WordPress手机端底部悬浮窗哪些网站可以seo
  • 网站的代理页面怎么做软文推广发布平台
  • 软件开发合同范本免费win10优化软件
  • 外发加工是否有专门的网站帮忙推广的平台
  • ppt做的比较好的网站网页优化包括什么
  • 宁夏电建网站合肥网络推广平台
  • 企业网站制作找什么人兴安盟新百度县seo快速排名
  • 专做餐饮的网站排名优化公司哪家靠谱
  • 北京做网站建设的公司零基础学什么技术好
  • 3建设营销型网站流程图google推广怎么做
  • 如何建立国际网站网页设计培训
  • 那家公司做网站好资源平台
  • 自己做的网站360显示过期怎么制作网址
  • 杭州网站建站公司手游cpa推广平台
  • 网站片头怎么做百度学术论文查重免费
  • 网站做效果联系方式竞价点击软件排名
  • 开发软件自学步骤北京关键词seo
  • 微小旅行社能否做网站百度推广公司怎么代理到的
  • 杭州建设网站制作国内最好的危机公关公司
  • 完美建设工程有限公司网站中国市场营销网
  • 新手做啥网站好西安百度关键词排名服务
  • 源码网站建设大数据智能营销系统
  • 肇庆百度seo代理seo发展前景怎么样啊
  • 专门做酒店的招聘网站网站建设步骤流程详细介绍
  • 亳州是网站建设微博付费推广有用吗
  • 网站建设ppt课件打开百度app