摘要: int uniqueMorseRepresentations(char ** words, int wordsSize){ char* morse[26] = { ".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "....", "..", ". ", 阅读全文
posted @ 2020-08-28 20:49 温暖了寂寞 阅读(163) 评论(0) 推荐(0) 编辑
摘要: bool uniqueOccurrences(int* arr, int arrSize){ int phash[1001] = {0}; // 存放正数次数 int nhash[1001] = {0}; // 存放负数次数 int hash[1001] = {0}; // 存放次数的次数 for 阅读全文
posted @ 2020-08-28 11:14 温暖了寂寞 阅读(164) 评论(0) 推荐(0) 编辑
摘要: bool func(struct TreeNode* node,int val) { if (!node) return true; if (node->val != val) return false; return func(node->left,val) && func(node->right 阅读全文
posted @ 2020-08-28 10:36 温暖了寂寞 阅读(63) 评论(0) 推荐(0) 编辑
摘要: bool isAnagram(char * s, char * t){ int n=strlen(s),m=strlen(t); if(n!=m)return false; if (!*s && !*t) return true; if (strlen(s) == 1 && strlen(t) == 阅读全文
posted @ 2020-08-28 10:15 温暖了寂寞 阅读(183) 评论(0) 推荐(0) 编辑