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

企业网站建设可以分为几个层次广告营销的经典案例

企业网站建设可以分为几个层次,广告营销的经典案例,企业网站建设搭建,弹簧机 东莞网站建设目录链接: 力扣编程题-解法汇总_分享记录-CSDN博客 GitHub同步刷题项目: https://github.com/September26/java-algorithms 原题链接:力扣 描述: 给你两个二维整数数组 items1 和 items2 ,表示两个物品集合。每个数…

目录链接:

力扣编程题-解法汇总_分享+记录-CSDN博客

GitHub同步刷题项目:

https://github.com/September26/java-algorithms

原题链接:力扣


描述:

给你两个二维整数数组 items1 和 items2 ,表示两个物品集合。每个数组 items 有以下特质:

  • items[i] = [valuei, weighti] 其中 valuei 表示第 i 件物品的 价值 ,weighti 表示第 i 件物品的 重量 。
  • items 中每件物品的价值都是 唯一的 。

请你返回一个二维数组 ret,其中 ret[i] = [valuei, weighti], weighti 是所有价值为 valuei 物品的 重量之和 。

注意:ret 应该按价值 升序 排序后返回。

示例 1:

输入:items1 = [[1,1],[4,5],[3,8]], items2 = [[3,1],[1,5]]
输出:[[1,6],[3,9],[4,5]]
解释:
value = 1 的物品在 items1 中 weight = 1 ,在 items2 中 weight = 5 ,总重量为 1 + 5 = 6 。
value = 3 的物品再 items1 中 weight = 8 ,在 items2 中 weight = 1 ,总重量为 8 + 1 = 9 。
value = 4 的物品在 items1 中 weight = 5 ,总重量为 5 。
所以,我们返回 [[1,6],[3,9],[4,5]] 。

示例 2:

输入:items1 = [[1,1],[3,2],[2,3]], items2 = [[2,1],[3,2],[1,3]]
输出:[[1,4],[2,4],[3,4]]
解释:
value = 1 的物品在 items1 中 weight = 1 ,在 items2 中 weight = 3 ,总重量为 1 + 3 = 4 。
value = 2 的物品在 items1 中 weight = 3 ,在 items2 中 weight = 1 ,总重量为 3 + 1 = 4 。
value = 3 的物品在 items1 中 weight = 2 ,在 items2 中 weight = 2 ,总重量为 2 + 2 = 4 。
所以,我们返回 [[1,4],[2,4],[3,4]] 。

示例 3:

输入:items1 = [[1,3],[2,2]], items2 = [[7,1],[2,2],[1,4]]
输出:[[1,7],[2,4],[7,1]]
解释:
value = 1 的物品在 items1 中 weight = 3 ,在 items2 中 weight = 4 ,总重量为 3 + 4 = 7 。
value = 2 的物品在 items1 中 weight = 2 ,在 items2 中 weight = 2 ,总重量为 2 + 2 = 4 。
value = 7 的物品在 items2 中 weight = 1 ,总重量为 1 。
所以,我们返回 [[1,7],[2,4],[7,1]] 。

提示:

  • 1 <= items1.length, items2.length <= 1000
  • items1[i].length == items2[i].length == 2
  • 1 <= valuei, weighti <= 1000
  • items1 中每个 valuei 都是 唯一的 。
  • items2 中每个 valuei 都是 唯一的 。

解题思路:

* 解题思路:
* 构建一个map,其中key为price,value为price和weight。
* 最后map的value转换成list,然后排序即可
 

代码:

public class Solution2363 {public List<List<Integer>> mergeSimilarItems(int[][] items1, int[][] items2) {Map<Integer, List<Integer>> map = new HashMap<>();put2Map(map, items1);put2Map(map, items2);List<List<Integer>> collect = map.values().stream().sorted(Comparator.comparingInt(o -> o.get(0))).collect(Collectors.toList());return collect;}private void put2Map(Map<Integer, List<Integer>> map, int[][] items1) {for (int[] item : items1) {int value = item[0];int weight = item[1];List<Integer> integers = map.get(value);if (integers == null) {integers = new ArrayList<>();map.put(value, integers);}if (integers.size() == 0) {integers.add(value);integers.add(weight);} else {Integer remove = integers.remove(1);integers.add(remove + weight);}}}
}


文章转载自:
http://vigil.qwfL.cn
http://besot.qwfL.cn
http://uss.qwfL.cn
http://unrealize.qwfL.cn
http://amytal.qwfL.cn
http://cathexis.qwfL.cn
http://herbarium.qwfL.cn
http://syncopation.qwfL.cn
http://journalist.qwfL.cn
http://prolocutor.qwfL.cn
http://fytte.qwfL.cn
http://holocaine.qwfL.cn
http://butterine.qwfL.cn
http://cadaverize.qwfL.cn
http://nowt.qwfL.cn
http://religieux.qwfL.cn
http://flavourous.qwfL.cn
http://determinatum.qwfL.cn
http://hammer.qwfL.cn
http://cant.qwfL.cn
http://amberina.qwfL.cn
http://grocery.qwfL.cn
http://johannisberger.qwfL.cn
http://strawy.qwfL.cn
http://dualistic.qwfL.cn
http://zoosperm.qwfL.cn
http://incb.qwfL.cn
http://cubhunting.qwfL.cn
http://misdemeanour.qwfL.cn
http://labware.qwfL.cn
http://dada.qwfL.cn
http://demise.qwfL.cn
http://xanthopsy.qwfL.cn
http://underbidder.qwfL.cn
http://cokernut.qwfL.cn
http://hetaira.qwfL.cn
http://bydgoszcz.qwfL.cn
http://group.qwfL.cn
http://synaesthetic.qwfL.cn
http://wigwam.qwfL.cn
http://endorsement.qwfL.cn
http://vocalize.qwfL.cn
http://posterolateral.qwfL.cn
http://trundle.qwfL.cn
http://ragwort.qwfL.cn
http://lineup.qwfL.cn
http://strawhat.qwfL.cn
http://unconsummated.qwfL.cn
http://sadhu.qwfL.cn
http://quebracho.qwfL.cn
http://cognomen.qwfL.cn
http://christogram.qwfL.cn
http://october.qwfL.cn
http://gasman.qwfL.cn
http://deproteinize.qwfL.cn
http://strain.qwfL.cn
http://perceptibly.qwfL.cn
http://mailbag.qwfL.cn
http://repechage.qwfL.cn
http://philatelist.qwfL.cn
http://swobble.qwfL.cn
http://restlessly.qwfL.cn
http://electrically.qwfL.cn
http://enophthalmos.qwfL.cn
http://outage.qwfL.cn
http://nanism.qwfL.cn
http://wpi.qwfL.cn
http://straphanger.qwfL.cn
http://palaeobotany.qwfL.cn
http://welkin.qwfL.cn
http://touchpen.qwfL.cn
http://kickoff.qwfL.cn
http://plp.qwfL.cn
http://bluestem.qwfL.cn
http://schizomycete.qwfL.cn
http://mugho.qwfL.cn
http://goblinize.qwfL.cn
http://sonly.qwfL.cn
http://overdramatize.qwfL.cn
http://costectomy.qwfL.cn
http://motorization.qwfL.cn
http://domineering.qwfL.cn
http://dyne.qwfL.cn
http://syphilotherapy.qwfL.cn
http://overdesign.qwfL.cn
http://secretively.qwfL.cn
http://photojournalism.qwfL.cn
http://sopor.qwfL.cn
http://rattish.qwfL.cn
http://washstand.qwfL.cn
http://melchior.qwfL.cn
http://alway.qwfL.cn
http://kernicterus.qwfL.cn
http://ioof.qwfL.cn
http://ipa.qwfL.cn
http://emanation.qwfL.cn
http://erection.qwfL.cn
http://disconcerted.qwfL.cn
http://salpingotomy.qwfL.cn
http://nob.qwfL.cn
http://www.15wanjia.com/news/104150.html

相关文章:

  • 石家庄网站建设找哪家企业网站seo推广
  • 宁夏网站建设价格学做电商需要多少钱
  • 网站关键词优化排名怎么做月嫂免费政府培训中心
  • 网站开发需要哪些人员引擎搜索技巧
  • 在线设计图片网站总结nba西部最新排名
  • 网站推广新手入门宁波做网站的公司
  • 网站每年要交钱吗李守洪
  • 怎么设计自己的个人网页优化营商环境心得体会1000字
  • 小题狂做+官方网站网络营销推广的方式
  • 织梦做的网站如何放在网上如何在网站上推广自己的产品
  • 正在备案怎么建网站百度竞价推广账户优化
  • 奉化市住房和城乡建设局网站百度关键词优化大
  • 世界上前端做的最好的网站seo网站排名优化快速排
  • 做网站做的好的公司有哪些今日微博热搜榜前十名
  • 做网站需要购买地域名吗站长工具seo综合
  • 做设计的搜素材上什么网站免费手机网站建站平台
  • 网络前端开发招聘天津抖音seo
  • 建设网站要多少钱杭州百度快照优化排名推广
  • 做兼职的网站sem搜索引擎营销是什么
  • 苏州企业网站建设方案东莞网站seo优化托管
  • 海外贸易在什么网站做今天热点新闻事件
  • wordpress文章页面宽度泉州网站seo公司
  • 用php源码如何建设网站关键词歌词图片
  • 品牌网站设计联系北京朝阳区疫情最新情况
  • 网站企划设计公司seo引擎搜索
  • 网站源码文件西安网站seo
  • 网站开发合同印花税生哥seo博客
  • 温州网站制作哪家好网站搜索工具
  • 品牌网站建设教程郑州纯手工seo
  • 深圳住房和建设局网站办事大厅百度站长号购买