leetcode290】的更多相关文章

题目: Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that there is a bijection between a letter in pattern and a non-empty word in str. Examples: pattern = "abba", str = "dog cat c…
Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that there is a bijection between a letter in pattern and a non-empty word in str. Example 1: Input: pattern = "abba", str = "dog c…
public class Solution { public bool WordPattern(string pattern, string str) { var list = str.Split(' ').ToList(); ; ; StringBuilder sb1 = new StringBuilder(); StringBuilder sb2 = new StringBuilder(); Dictionary<string, int> dic1 = new Dictionary<…