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

企业网站优化工具网站备案空间备案吗

企业网站优化工具,网站备案空间备案吗,wordpress 条件查询数据库,帮公司制作一个网站是如何收费★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★➤微信公众号#xff1a;山青咏芝#xff08;shanqingyongzhi#xff09;➤博客园地址#xff1a;山青咏芝#xff08;https://www.cnblogs.com/strengthen/#xff09;➤GitHub地址山青咏芝shanqingyongzhi➤博客园地址山青咏芝https://www.cnblogs.com/strengthen/➤GitHub地址https://github.com/strengthen/LeetCode➤原文地址https://www.cnblogs.com/strengthen/p/9900712.html ➤如果链接不是山青咏芝的博客园地址则可能是爬取作者的文章。➤原文已修改更新强烈建议点击原文地址阅读支持作者支持原创★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ Given a set of candidate numbers (candidates) (without duplicates) and a target number (target), find all unique combinations in candidates where the candidate numbers sums to target. The same repeated number may be chosen from candidates unlimited number of times. Note: All numbers (including target) will be positive integers.The solution set must not contain duplicate combinations.Example 1: Input: candidates [2,3,6,7], target 7, A solution set is: [[7],[2,2,3] ]Example 2: Input: candidates [2,3,5], target 8, A solution set is: [[2,2,2,2],[2,3,3],[3,5] ] 给定一个无重复元素的数组 candidates 和一个目标数 target 找出 candidates 中所有可以使数字和为 target 的组合。 candidates 中的数字可以无限制重复被选取。 说明 所有数字包括 target都是正整数。解集不能包含重复的组合。 示例 1: 输入: candidates [2,3,6,7], target 7, 所求解集为: [[7],[2,2,3] ]示例 2: 输入: candidates [2,3,5], target 8, 所求解集为: [[2,2,2,2],[2,3,3],[3,5] ] 20ms 1 class Solution {2 var result [[Int]]()3 func combinationSum(_ candidates: [Int], _ target: Int) - [[Int]] {4 combinationSum(candidates, target, 0, [Int]())5 return result6 }7 8 func combinationSum(_ candidates: [Int], _ target: Int, _ currentInex: Int, _ usdedNums: [Int]) {9 if target 0 { 10 if target 0 { 11 result.append(usdedNums) 12 } 13 return 14 } 15 for i in currentInex..candidates.count { 16 let currentValue candidates[i] 17 if currentValue target { 18 continue 19 } 20 var usdedNumsCopy usdedNums 21 usdedNumsCopy.append(currentValue) 22 combinationSum(candidates, target-currentValue, i, usdedNumsCopy) 23 } 24 } 25 } 24ms 1 class Solution {2 func combinationSum(_ candidates: [Int], _ target: Int) - [[Int]] {3 let candidatesCopy candidates.sorted{ $0 $1 }4 var tmp [Int]()5 var res [[Int]]()6 var index 07 helper(tmp, res, index, candidatesCopy, target)8 return res9 } 10 11 private func helper(_ tmp: inout [Int], _ res: inout [[Int]], _ index: Int, _ candidatesCopy: [Int], _ target: Int) { 12 if target 0 { 13 res.append(tmp) 14 return 15 }else if index candidatesCopy.count { 16 return 17 } 18 19 for i in index..candidatesCopy.count { 20 if candidatesCopy[i] target { 21 return 22 }else if i ! index candidatesCopy[i] candidatesCopy[i - 1] { 23 continue 24 } 25 26 tmp.append(candidatesCopy[i]) 27 helper(tmp, res, i, candidatesCopy, target - candidatesCopy[i]) 28 tmp.removeLast() 29 } 30 } 31 } 28ms 1 class Solution {2 func combinationSum(_ candidates: [Int], _ target: Int) - [[Int]] {3 var result [[Int]]()4 var out [Int]()5 var candidates candidates.sorted()6 combinationSumDFS(candidates, target, 0, out, result)7 return result8 }9 10 func combinationSumDFS(_ candidates: [Int], _ target: Int, _ start: Int, _ out: inout [Int], _ res: inout [[Int]]) { 11 if target 0 { 12 res.append(out) 13 } else { 14 for i in start..candidates.count { 15 guard target - candidates[i] 0 else { 16 break 17 } 18 out.append(candidates[i]) 19 combinationSumDFS(candidates, target - candidates[i], i, out, res) 20 out.remove(at: out.count - 1) 21 22 } 23 } 24 } 25 26 } 28ms 1 class Solution {2 3 var list [[Int]]()4 5 func combinationSum(_ candidates: [Int], _ target: Int) - [[Int]] {6 var currentlySelected [Int]()7 recursiveCombSum(candidates: candidates, index: 0, target: target, currentlySelected: currentlySelected)8 return list9 } 10 11 func recursiveCombSum(candidates: [Int], index: Int, target: Int, currentlySelected: [Int]) { 12 if 0 target { 13 list [currentlySelected] 14 } 15 if index candidates.count { 16 } else { 17 for i in index..candidates.count { 18 if candidates[i] target { 19 var newTarget target - candidates[i] 20 var newList currentlySelected [candidates[i]] 21 recursiveCombSum(candidates: candidates, index: i, target: newTarget, currentlySelected: newList) 22 } 23 } 24 } 25 } 26 } 56ms 1 class Solution {2 var conbineArray [[Int]]()3 func combinationSum(_ candidates: [Int], _ target: Int) - [[Int]] {4 let count candidates.count5 guard count 0 else {6 return [[Int]]()7 }8 combine(candidates, [Int](), count, 0, target)9 return conbineArray 10 } 11 12 func combine(_ candidates: [Int], _ currentCombine: [Int], _ count: Int, _ index: Int, _ target: Int) { 13 if target 0 { return } 14 if index count { return } 15 if target 0 { 16 conbineArray.append(currentCombine) 17 return 18 } 19 20 combine(candidates, currentCombine, count, index 1, target) 21 var currentCombine currentCombine 22 currentCombine.append(candidates[index]) 23 combine(candidates, currentCombine, count, index, target - candidates[index]) 24 } 25 }  转载于:https://www.cnblogs.com/strengthen/p/9900712.html
http://www.pierceye.com/news/826943/

相关文章:

  • 徐州网站的优化苏州百度推广开户
  • 网站有多少个网站建设与管理介绍
  • 网站建站报告2000字查询公司的网站
  • 兰州网站制作服务电话博客建站模板
  • 网站后台登陆路径网站网站优化
  • wordpress仿站方法网站图片做伪静态
  • 怎么做一款贷款网站蚌埠seo公司
  • 做羊水亲子鉴定网站企业vi设计公司定制
  • 网站开发和微信开发需要什么人一个服务器放多少网站
  • 做6个页面的网站郑州seo优化顾问热狗
  • 网站建设 落地页中国石化工程建设有限公司怎么样
  • 网站建设 软文发布wordpress调取列表页
  • php网站服务器架设清远哪里有网页设计培训学费
  • 建站开发搜索引擎排名查询
  • 如何建设自己的网站 知乎怎么做电力设计公司网站
  • 效果图代做网站网站服务体系
  • 成都网站开发团队减肥养生网站建设
  • 个人做网站需要资质吗用php做网站的书籍
  • 开发一个交易网站多少钱做哪类网站比较赚钱
  • 帮人做彩票网站支付接口成都网络推广培训哪家好
  • 电子商务网站建设的教案404 not found wordpress
  • 怎样建设一个购物网站什么网站可以做直播
  • 石家庄网站开发培训灵犀科技网站开发佼佼者
  • 做阿里还是网站三个律师做网站合适吗
  • 梅州做网站设计公司网站 在百度搜索不到
  • 临沂门户网站制作微信附近人推广引流
  • 九龙坡区网站建设外贸是什么工作
  • 贵州省住房和城乡建设厅网站报名网网站开发入职转正申请书
  • 外贸平台哪个网站好做dede网站白屏
  • 可信的手机网站建设服装网站ui设计