摘要: 一个 句子 由一些 单词 以及它们之间的单个空格组成,句子的开头和结尾不会有多余空格。 给你一个字符串数组 sentences ,其中 sentences[i] 表示单个 句子 。 请你返回单个句子里 单词的最多数目 。 示例 1: 输入:sentences = ["alice and bob lo 阅读全文
posted @ 2023-10-09 18:36 beautiful-life 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 、给你一个字符串数组 words 和一个字符串 s ,请你判断 s 是不是 words 的 首字母缩略词 。 如果可以按顺序串联 words 中每个字符串的第一个字符形成字符串 s ,则认为 s 是 words 的首字母缩略词。例如,"ab" 可以由 ["apple", "banana"] 形成,但 阅读全文
posted @ 2023-10-09 15:28 beautiful-life 阅读(12) 评论(0) 推荐(0) 编辑
摘要: 给你一个由不同字符组成的字符串 allowed 和一个字符串数组 words 。如果一个字符串的每一个字符都在 allowed 中,就称这个字符串是 一致字符串 。 请你返回 words 数组中 一致字符串 的数目。 示例 1: 输入:allowed = "ab", words = ["ad","b 阅读全文
posted @ 2023-10-09 15:26 beautiful-life 阅读(3) 评论(0) 推荐(0) 编辑