摘要:
773. 有效的字母异位词 中文English 给定两个字符串 s 和 t ,编写一个函数来判断 t 是否是 s 的字母异位词。 样例 样例 1: 输入: s = "anagram", t = "nagaram" 输出: true 样例 2: 输入: s = "rat", t = "car" 输出: 阅读全文
摘要:
1.enumerate() ##可以得到列表对应的索引和对应索引的值 S = '1ab4ct' for i ,_ in enumerate(S): ##判断是否是字符串 if _.isalpha() == True: print(i,_) 执行结果: 2.[...for...] ##可以得到小于5的 阅读全文
摘要:
686. 删除多余的空格 中文English 从句子中删除多余空格 样例 Example 1: Input: s = "The sky is blue" Output: "The sky is blue" Example 2: Input: s = " low ercase " Output: "l 阅读全文