摘要: 自己写的,好像有点复杂: class Solution: def wordPattern(self, pattern: str, s: str) -> bool: # 将字符串 s 按空格切分成单词列表 mystr = s.split() # 创建一个空字典,用于存储字符和其出现位置的映射 mydi 阅读全文
posted @ 2024-03-29 13:54 Junior_bond 阅读(22) 评论(0) 推荐(0)