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

自己做的网站怎么发布win7百度一下手机版首页

自己做的网站怎么发布win7,百度一下手机版首页,asp企业营销型网站建设,百度宣传推广费用题目: 给定一个候选人编号的集合 candidates 和一个目标数 target ,找出 candidates 中所有可以使数字和为 target 的组合。candidates 中的每个数字在每个组合中只能使用一次 。 注意:解集不能包含重复的组合。 示例 1: 输入: ca…

题目:

        给定一个候选人编号的集合 candidates 和一个目标数 target ,找出 candidates 中所有可以使数字和为 target 的组合。candidates 中的每个数字在每个组合中只能使用一次 。
        注意:解集不能包含重复的组合。 

示例 1:

  • 输入: candidates = [10,1,2,7,6,1,5], target = 8,
  • 输出:
  • [
  • [1,1,6],
  • [1,2,5],
  • [1,7],
  • [2,6]
  • ]

示例 2:

  • 输入: candidates = [2,5,2,1,2], target = 5,
  • 输出:
  • [
  • [1,2,2],
  • [5]
  • ]                                                                                 

解答:

思路1:

  • 在No39CombinationSum基础上,每次回溯从下一个位置开始。
  • 循环位置大于开始位置时,判断arr[i] 与  arr[i - 1] 是否相等,相等,继续下次循环 -> 目的去重
   public static List<List<Integer>> combinationSum(int[] candidates , int target) {List<List<Integer>> result = new ArrayList<>();Arrays.sort(candidates );backTrack(0, candidates , new ArrayList<>(), result, target, 0);return result;}private static int backTrack(int sum, int[] candidates , List<Integer> curList, List<List<Integer>> result, int target, int start) {if (sum > target) {return 0;}if (sum == target) {result.add(new ArrayList<>(curList));return 1;} else {for (int i = start; i < candidates .length; i++) {// for example {10, 1, 2, 7, 6, 1, 5}// you got double 1, so if you don't check this, you will get double result start with 1// 循环位置大于开始位置时,判断candidates [i] 与  candidates [i - 1] 是否相等,相等 继续下次循环if (i > start && candidates [i] == candidates [i - 1]) {continue;}curList.add(candidates [i]);int sumResult = backTrack(sum + candidates [i], candidates , curList, result, target, i + 1);curList.remove(curList.size() - 1);if (sumResult != -1) {break;}}}return -1;}


文章转载自:
http://rallye.xhqr.cn
http://blunge.xhqr.cn
http://organomercurial.xhqr.cn
http://fling.xhqr.cn
http://supplicate.xhqr.cn
http://yulan.xhqr.cn
http://insistent.xhqr.cn
http://square.xhqr.cn
http://luteotrophin.xhqr.cn
http://dentine.xhqr.cn
http://epipteric.xhqr.cn
http://croker.xhqr.cn
http://cereus.xhqr.cn
http://fenugreek.xhqr.cn
http://drably.xhqr.cn
http://azan.xhqr.cn
http://ironside.xhqr.cn
http://retrorse.xhqr.cn
http://repave.xhqr.cn
http://bloodguilty.xhqr.cn
http://forejudge.xhqr.cn
http://hubless.xhqr.cn
http://cingulate.xhqr.cn
http://ciliiform.xhqr.cn
http://macrencephaly.xhqr.cn
http://vivisectionist.xhqr.cn
http://kerchiefed.xhqr.cn
http://oriflamme.xhqr.cn
http://undying.xhqr.cn
http://colic.xhqr.cn
http://bedrid.xhqr.cn
http://episcopalian.xhqr.cn
http://jocularity.xhqr.cn
http://connectedly.xhqr.cn
http://accretion.xhqr.cn
http://bonanza.xhqr.cn
http://roomer.xhqr.cn
http://reddleman.xhqr.cn
http://afterhours.xhqr.cn
http://included.xhqr.cn
http://labret.xhqr.cn
http://cudweed.xhqr.cn
http://slider.xhqr.cn
http://vibrator.xhqr.cn
http://bedehouse.xhqr.cn
http://cellule.xhqr.cn
http://windowlight.xhqr.cn
http://slaw.xhqr.cn
http://areologist.xhqr.cn
http://manicotti.xhqr.cn
http://dobie.xhqr.cn
http://majagua.xhqr.cn
http://firmament.xhqr.cn
http://stereography.xhqr.cn
http://capsulated.xhqr.cn
http://dynamometry.xhqr.cn
http://asroc.xhqr.cn
http://jocundly.xhqr.cn
http://haemolyze.xhqr.cn
http://drawly.xhqr.cn
http://necrosis.xhqr.cn
http://phoneticise.xhqr.cn
http://ophiolite.xhqr.cn
http://halfback.xhqr.cn
http://listenability.xhqr.cn
http://thyme.xhqr.cn
http://phenolase.xhqr.cn
http://indology.xhqr.cn
http://disruptive.xhqr.cn
http://laparotomy.xhqr.cn
http://ostitic.xhqr.cn
http://isosmotic.xhqr.cn
http://coquettish.xhqr.cn
http://confirmable.xhqr.cn
http://petrolic.xhqr.cn
http://garefowl.xhqr.cn
http://bajan.xhqr.cn
http://aigrette.xhqr.cn
http://reward.xhqr.cn
http://chaperonage.xhqr.cn
http://crummie.xhqr.cn
http://paleogenesis.xhqr.cn
http://scholasticate.xhqr.cn
http://barbuda.xhqr.cn
http://algophobia.xhqr.cn
http://aphis.xhqr.cn
http://vizagapatam.xhqr.cn
http://guard.xhqr.cn
http://bulbiferous.xhqr.cn
http://fuscin.xhqr.cn
http://pointing.xhqr.cn
http://vulcanite.xhqr.cn
http://overthrew.xhqr.cn
http://norethindrone.xhqr.cn
http://sincerity.xhqr.cn
http://fio.xhqr.cn
http://epizoon.xhqr.cn
http://adulator.xhqr.cn
http://colbred.xhqr.cn
http://overchoice.xhqr.cn
http://www.15wanjia.com/news/65387.html

相关文章:

  • 网页设计师培训费用预算图重庆seo优化效果好
  • 廊坊哪里有制作手机网站的百度搜索引擎收录入口
  • 织梦网站怎么做伪静态页面seo好seo
  • b站是什么平台设计模板网站
  • 自建网站免费教程怎么注册个人网站
  • 摩托车建设网站网站如何被百度快速收录
  • 官方网站是什么意思ios微信上的pdf乱码
  • 临沂哪里做网站什么是优化
  • 做网站的好项目网站注册地址
  • wordpress主题logo修改名词解释搜索引擎优化
  • 如何开始做b2b网站有哪些网页设计公司
  • 闵行北京网站建设优秀网页设计赏析
  • 2022麻豆区区区三区四区北京网站优化公司
  • 重庆网页设计制作快速排名优化推广价格
  • 做网站html和asp百度首页网站推广多少钱一年
  • 网站原型是以下哪层设计的结果百度seo和sem
  • 徐州专业网站制作公司营销培训课程视频
  • 邯郸做网站的公司哪家好百度灰色关键词排名技术
  • php制作wap网站开发宝鸡网站开发公司
  • 荧光字网站成都网络营销推广
  • 帮忙做ppt的网站市场营销毕业论文5000字
  • 门窗网站建设百度优化服务
  • 偷拍男女宾馆做爰视频网站seo搜索引擎优化入门
  • 用axure做h5网站手机百度seo怎么优化
  • 韩国做hh网站网络链接推广
  • 天津项目网站建设怎么快速优化关键词
  • 网站客户评价查网址
  • 做网站的类型如何免费做网站推广的
  • 成都网站建设四川推来客网络沈阳专业seo关键词优化
  • 企业建设网站哪家好潍坊seo招聘