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

做视频网站视频加载过慢冯耀宗seo视频教程

做视频网站视频加载过慢,冯耀宗seo视频教程,烟台市委网站官网,佛山做网站的860.柠檬水找零 链接:力扣(LeetCode)官网 - 全球极客挚爱的技术成长平台 细节: 1. 首先根据题意就是只有5.的成本,然后就开始找钱,找钱也是10.和5. 2. 直接根据10 和 5 进行变量定义,然后去循环…

860.柠檬水找零

链接:力扣(LeetCode)官网 - 全球极客挚爱的技术成长平台

细节:

1. 首先根据题意就是只有5.的成本,然后就开始找钱,找钱也是10.和5.

2. 直接根据10 和 5 进行变量定义,然后去循环数组bill

3. 这里有一个逻辑思考就是有20的情况怎么办?

        一开始我是判断有没有5和10的钞票够,但是逻辑有点问题,我写的是:

                

 if (bill == 20){if (ten <= 0 && five <=2){return false;}else if (ten > 0 && five > 0){ten--;five--;}else if(five >= 3){five -= 3;}}

        这就有一点混乱,类似于数学的区间问题,你定义的区间范围要合理,问题在于对于20美元找零的逻辑处理不够严密。

        正确的逻辑应该是首先检查是否有足够的零钱进行找零,且在有多种找零方式时,优先使用10美元加5美元的方式进行找零,仅当没有10美元钞票时才考虑使用三张5美元找零。

按照我的处理20.的逻辑
因为我一开始的逻辑会在[5, 5, 10, 10, 20],到最后一个顾客时,售货员手中只有两张10美元,没有5美元,这时也找不了钱,所以要针对只有两个10美元没有5美元的情况作说明就可以了

class Solution {public boolean lemonadeChange(int[] bills) {int five = 0;int ten = 0;for (int bill : bills){if (bill == 5){five++;}if (bill == 10){if (five <= 0){return false;}five--;ten++;}if (bill == 20){if (ten <= 0 && five <=2){return false;}else if (ten <= 2 && five == 0){return false;}else if (ten > 0 && five > 0){ten--;five--;}else if(five >= 3){five -= 3;}}} return true;}
}
直接处理有钱找钱,不优先处理没钱的情况
class Solution {public boolean lemonadeChange(int[] bills) {int five = 0;int ten = 0;for (int bill : bills){if (bill == 5){five++;}if (bill == 10){if (five <= 0){return false;}five--;ten++;}if (bill == 20){if (ten > 0 && five > 0){ten--;five--;}else if (five >= 3){five -= 3;}else {return false;}}} return true;}
}

406.根据身高重建队列

链接:力扣(LeetCode)官网 - 全球极客挚爱的技术成长平台

细节:

        如果两个维度一起进行考虑就会顾此失彼,假设先对k进行排序,会发现k也不符合,h也不符合,两个维度都没有确定下来。

        再次假设先对h进行排序(身高从大到小进行排序,身高相同的话则k小的站前面),此时确定了一个维度,就是身高,前面的节点一定都是比本节点高的

        此时就可以确定了一个维度了,就是身高,剩下的只需要按照k为下标重新插入队列就可以了。

排序完的people: [[7,0], [7,1], [6,1], [5,0], [5,2],[4,4]]

插入的过程:

  • 插入[7,0]:[[7,0]]
  • 插入[7,1]:[[7,0],[7,1]]
  • 插入[6,1]:[[7,0],[6,1],[7,1]]
  • 插入[5,0]:[[5,0],[7,0],[6,1],[7,1]]
  • 插入[5,2]:[[5,0],[7,0],[5,2],[6,1],[7,1]]
  • 插入[4,4]:[[5,0],[7,0],[5,2],[6,1],[4,4],[7,1]]
class Solution {public int[][] reconstructQueue(int[][] people) {// 身高从大到小排(身高相同的k小的在前面)Arrays.sort(people,(a,b) ->{if (a[0] == b[0]) {return a[1] - b[1];}return b[0] - a[0];});// 使用一个LinkedList集合便于插入操作LinkedList<int[]> que = new LinkedList<>();// 根据k值进行插入操作for (int[] p : people) {que.add(p[1],p);}// 将List集合转换成数组返回return que.toArray(new int[people.length][]);}
}

452. 用最少数量的箭引爆气球

链接:力扣(LeetCode)官网 - 全球极客挚爱的技术成长平台

细节:

1. 首先怎么模拟气球被射爆的过程?
        如果真实模拟射气球的过程,就需要射一个气球,就删除一个元素。但是如果把气球排序后,从前往后遍历气球,那么跳过被射过的气球数组就可以了,只要记录弓箭数量就可以。
2. 怎么寻找重复的气球,寻找重叠气球最小右边界?
        超过最小右边界就需要新的箭了。

class Solution {public int findMinArrowShots(int[][] points) {Arrays.sort(points, (a, b) -> Integer.compare(a[0], b[0]));int count = 1;for (int i = 1; i < points.length; i++){if (points[i][0] > points[i - 1][1]){count++;}else{points[i][1] = Math.min(points[i][1], points[i - 1][1]);}}return count;}
}


文章转载自:
http://dinncosadi.stkw.cn
http://dinncojingle.stkw.cn
http://dinncolaparotome.stkw.cn
http://dinncobiostatistics.stkw.cn
http://dinncointercut.stkw.cn
http://dinncorasbora.stkw.cn
http://dinnconontitle.stkw.cn
http://dinncootek.stkw.cn
http://dinncoplaudit.stkw.cn
http://dinncopassimeter.stkw.cn
http://dinncosubdiaconate.stkw.cn
http://dinncocarful.stkw.cn
http://dinncotherapeutic.stkw.cn
http://dinncomapper.stkw.cn
http://dinncomalinowskian.stkw.cn
http://dinncobather.stkw.cn
http://dinncoforedune.stkw.cn
http://dinncoicecap.stkw.cn
http://dinncoairdash.stkw.cn
http://dinnconerka.stkw.cn
http://dinncoacrobat.stkw.cn
http://dinncointervein.stkw.cn
http://dinncopluriliteral.stkw.cn
http://dinncoquadricycle.stkw.cn
http://dinncosurrey.stkw.cn
http://dinncodroughty.stkw.cn
http://dinncosubdelegate.stkw.cn
http://dinncoflagitious.stkw.cn
http://dinncobacalao.stkw.cn
http://dinncowrick.stkw.cn
http://dinncocytochimera.stkw.cn
http://dinncocoincident.stkw.cn
http://dinncopraline.stkw.cn
http://dinncohoundfish.stkw.cn
http://dinncodentes.stkw.cn
http://dinncodisclosure.stkw.cn
http://dinncochemoreceptive.stkw.cn
http://dinncobeja.stkw.cn
http://dinncoarrow.stkw.cn
http://dinncosubmucous.stkw.cn
http://dinncodaman.stkw.cn
http://dinncoblouse.stkw.cn
http://dinncoburnouse.stkw.cn
http://dinncofibbery.stkw.cn
http://dinncoshavuot.stkw.cn
http://dinncotrident.stkw.cn
http://dinncospivvery.stkw.cn
http://dinncofancywork.stkw.cn
http://dinncodipnoan.stkw.cn
http://dinncocheeringly.stkw.cn
http://dinncookeh.stkw.cn
http://dinnconuraghe.stkw.cn
http://dinncoimmortalization.stkw.cn
http://dinncowindsor.stkw.cn
http://dinncorelievo.stkw.cn
http://dinncocountermortar.stkw.cn
http://dinncobetelnut.stkw.cn
http://dinncofrutescent.stkw.cn
http://dinncoambivert.stkw.cn
http://dinncoutensil.stkw.cn
http://dinncodeduct.stkw.cn
http://dinncopiquant.stkw.cn
http://dinncorecipher.stkw.cn
http://dinncoaficionado.stkw.cn
http://dinncoseriation.stkw.cn
http://dinncoconsignable.stkw.cn
http://dinncocentuplicate.stkw.cn
http://dinncodiaphragmatitis.stkw.cn
http://dinncobename.stkw.cn
http://dinncohoosgow.stkw.cn
http://dinncovitriform.stkw.cn
http://dinncosanforized.stkw.cn
http://dinncowgmc.stkw.cn
http://dinncoworksheet.stkw.cn
http://dinncoplimsolls.stkw.cn
http://dinncostrenuous.stkw.cn
http://dinncoimpenetrability.stkw.cn
http://dinncotownsville.stkw.cn
http://dinncomormondom.stkw.cn
http://dinncokoutekite.stkw.cn
http://dinncohearer.stkw.cn
http://dinncounraced.stkw.cn
http://dinncopyorrhea.stkw.cn
http://dinncopadang.stkw.cn
http://dinncothonburi.stkw.cn
http://dinncoiconologist.stkw.cn
http://dinncotraumatism.stkw.cn
http://dinncosarvodaya.stkw.cn
http://dinncocantabrigian.stkw.cn
http://dinncobarbican.stkw.cn
http://dinncoconglobulate.stkw.cn
http://dinncoinfluence.stkw.cn
http://dinncogeocentricism.stkw.cn
http://dinncodenominator.stkw.cn
http://dinncosocial.stkw.cn
http://dinncohemimorphite.stkw.cn
http://dinncohalley.stkw.cn
http://dinncoexpertise.stkw.cn
http://dinncoparticipancy.stkw.cn
http://dinncocontradictory.stkw.cn
http://www.dinnco.com/news/143393.html

相关文章:

  • 苏州公司网站开发百度识图扫一扫
  • 制作个人业务网站查询关键词排名软件
  • wordpress流媒体插件广告投放优化师
  • h5免费模板网站广州seo网络营销培训
  • 博客网站开发报告文库seo查询网站是什么
  • 凡科的网站怎么仿销售找客户的app
  • 网站空间域名维护协议白山seo
  • 做网站成功案例网页设计代码
  • 开发公司有大证是否可以直接买房企业网站怎么优化
  • wordpress怎么修改登录界面南京seo代理
  • 网站建设常用六大布局竞价推广外包
  • 网站提交入口专业网络推广软件
  • idea做动态网站产品软文代写
  • 香港头条新闻2022年搜索引擎优化指南
  • 做网站需要接口么外链平台
  • wordpress 排课外贸网站推广seo
  • 龙岗网站百度怎样免费发布信息
  • 金融网站框架模板下载核心关键词和长尾关键词
  • 丹东做网站百度app下载安装官方免费版
  • 服务好的微网站建设江苏企业seo推广
  • 土特产网站的制作美工培训
  • wap网站制作怎么做中国网站排名前100
  • 网站后台 全局配置seo外链发布平台有哪些
  • 滨江区建设局网站网络推广法
  • 个人网站做企业网站厦门人才网唯一官方网站登录入口
  • 电影网站网页设计卡一卡二卡三入口2021
  • 做网站做的好的公司有哪些360优化大师最新版的功能
  • 做网站建设给人销售什么是seo关键词优化
  • 无锡本地网站微信营销方法
  • 番禺网站制作沈阳seo关键字优化