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

网站维护中一般要多长时间wordpress 分享到微信二维码

网站维护中一般要多长时间,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/10603493.html ➤如果链接不是山青咏芝的博客园地址则可能是爬取作者的文章。➤原文已修改更新强烈建议点击原文地址阅读支持作者支持原创★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★★ We are given two sentences A and B.  (A sentence is a string of space separated words.  Each word consists only of lowercase letters.) A word is uncommon if it appears exactly once in one of the sentences, and does not appear in the other sentence. Return a list of all uncommon words.  You may return the list in any order.  Example 1: Input: A this apple is sweet, B this apple is sour Output: [sweet,sour]Example 2: Input: A apple apple, B banana Output: [banana]  Note: 0 A.length 2000 B.length 200A and B both contain only spaces and lowercase letters.给定两个句子 A 和 B 。 句子是一串由空格分隔的单词。每个单词仅由小写字母组成。 如果一个单词在其中一个句子中只出现一次在另一个句子中却没有出现那么这个单词就是不常见的。 返回所有不常用单词的列表。 您可以按任何顺序返回列表。  示例 1 输入A this apple is sweet, B this apple is sour 输出[sweet,sour]示例 2 输入A apple apple, B banana 输出[banana]  提示 0 A.length 2000 B.length 200A 和 B 都只包含空格和小写字母。8ms 1 class Solution {2 func uncommonFromSentences(_ A: String, _ B: String) - [String] {3 var occurences [String: Int]()4 let addSubstringToOccurences { (substring: Substring) - Void in5 let word String(substring)6 occurences[word] (occurences[word] ?? 0) 17 }8 9 A.split(separator: ).forEach(addSubstringToOccurences) 10 B.split(separator: ).forEach(addSubstringToOccurences) 11 12 return Array(occurences.filter { $1 1 }.keys) 13 } 14 } 12ms 1 class Solution {2 func uncommonFromSentences(_ A: String, _ B: String) - [String] {3 var result : [String] []4 var DictA : [String:Int] [:]5 var DictB : [String:Int] [:]6 var wordsA A.components(separatedBy: )7 var wordsB B.components(separatedBy: )8 9 for word in wordsA { 10 if var count DictA[word] { 11 DictA[word] count 1 12 } else { 13 DictA[word] 1 14 } 15 } 16 17 for word in wordsB { 18 if var count DictB[word] { 19 DictB[word] count 1 20 } else { 21 DictB[word] 1 22 } 23 } 24 25 for key in DictA.keys { 26 if DictA[key] 1 DictB[key] nil { 27 result.append(key) 28 } 29 } 30 31 for key in DictB.keys { 32 if DictB[key] 1 DictA[key] nil { 33 result.append(key) 34 } 35 } 36 37 return result 38 } 39 } 16ms 1 class Solution {2 func uncommonFromSentences(_ A: String, _ B: String) - [String] {3 let str A B4 var dic DictionaryString,Int()5 var result [String]()6 let subStr str.split(separator: )7 let subs subStr.map { String($0)}8 for sub in subs {9 if nil dic[sub] { 10 dic[sub] 1 11 } else { 12 dic[sub] dic[sub]! 1 13 } 14 } 15 dic.filter { (arg0) - Bool in 16 17 let (key, value) arg0 18 if value 1 { 19 result.append(key) 20 return true 21 } else { 22 return false 23 } 24 } 25 return result 26 } 27 } Runtime: 20 ms Memory Usage: 20.3 MB 1 class Solution {2 func uncommonFromSentences(_ A: String, _ B: String) - [String] {3 var count:[String:Int] [String:Int]()4 var arr:[String] (A B).components(separatedBy: )5 for w in arr6 {7 count[w,default:0] 18 }9 var res:[String] [String]() 10 for w in count.keys 11 { 12 if count[w,default:0] 1 13 { 14 res.append(w) 15 } 16 } 17 return res 18 } 19 } 24ms 1 class Solution {2 func uncommonFromSentences(_ A: String, _ B: String) - [String] {3 4 var wordCountDict: [Substring : Int] [:]5 6 for word in A.split(separator: ) {7 wordCountDict[word] (wordCountDict[word] ?? 0) 18 }9 10 for word in B.split(separator: ) { 11 wordCountDict[word] (wordCountDict[word] ?? 0) 1 12 } 13 14 var answer: [String] [] 15 16 for (word, count) in wordCountDict { 17 if count 1 { 18 answer.append(String(word)) 19 } 20 } 21 22 return answer 23 } 24 } 32ms 1 class Solution {2 func uncommonFromSentences(_ A: String, _ B: String) - [String] {3 let words A.split(separator: ).map { String($0) } B.split(separator: ).map { String($0) }4 var countDict [String: Int]()5 6 for word in words {7 countDict[word] (countDict[word] ?? 0) 18 }9 10 return countDict.filter { $0.value 1 }.map { $0.key } 11 } 12 } 36ms 1 class Solution {2 func uncommonFromSentences(_ A: String, _ B: String) - [String] {3 var result: [String] []4 var count: [Substring: Int] [:]5 let arrayA A.split(separator: )6 let arrayB B.split(separator: )7 for s in arrayA {8 if let value count[s] {9 count[s] value 1 10 } else { 11 count[s] 1 12 } 13 } 14 for s in arrayB { 15 if let value count[s] { 16 count[s] value 1 17 } else { 18 count[s] 1 19 } 20 } 21 for (key,value) in count { 22 if value 1 { 23 result.append(String(key)) 24 } 25 } 26 return result 27 } 28 }   转载于:https://www.cnblogs.com/strengthen/p/10603493.html
http://wiki.neutronadmin.com/news/408566/

相关文章:

  • 网站 手机验证码 实例关键词推广优化外包
  • 连云港权威网站建设价格双语网站代码
  • 徐州做网站的设计师佛山移动网站建设公司
  • 做网站哪个行业比较有前景快速设计一个网站
  • 网站设计类论文怎么做南京本地网站
  • 如何推销网站网站计划
  • 营销型网站建设目的和意义佛山专业网站设计公司
  • 张家港网站seo腾冲网站建设的公司
  • 建设银行 u盾不弹出网站网站代运营多少钱一个月
  • asp网站服务器架设网站后台开发教程
  • 视频直播app开发网站帮别人做数学题赚钱的网站
  • 做网站6000左右的电脑视频网站源码下载
  • 自己主机做多个网站wordpress优秀的主题
  • 花卉网站建设推广交换链接网站
  • 成都 专业 网站建设网站怎样设计网址
  • 东城网站设计哪些网站是.net开发的
  • 成都网站制作售后黄页网站建设
  • 能在线做初中题的网站衡水市网站建设
  • 建设银行信用卡官方网站做公司网站都需要付什么费用
  • 福州网站建设的公司素材网有哪些
  • 网站设计 色彩做网站 搞流量 赚广告费
  • 桐乡网站制作导购网站模板
  • 网站导航容易做有关优化网站建设的书籍
  • 做网站 收费网站开发总监招聘
  • 外贸自己做网站好不好建免费网站
  • 东莞市专注网站建设邢台市建设局安全监督管理网站
  • 游戏网站制作模板威海网站建设开发公司
  • 大城网站制作织梦摄影网站源码
  • 国外网站建设软件有哪些做网站播放未上映的电影
  • seo网站设计物流公司图片