Algorithm lc442_数组中重复的数据 简单的一个集合的应用,C++可以用unordered_set,hash集合,但是今天以及之后的algorith
Algorithm lc1305_两棵二叉搜索树中的所有元素 感觉这题如果用goroutines的管道(缓冲为1)向主线程输送数据,应该很好做 就是一个生成器一样
Algorithm lc868_二进制间距 获取bit位的每一位n & -n,判断距离 之前富途面试考过,我当时为了简单,用了一个数组存,看着方便明了,但是面试官ge
Algorithm lc479_最大回文数乘积 思路 感觉这里要用到大数相乘的编码,就是用string来做乘法运算,并且还要结合乘积为最大回文数的规律, 这里不是很
Algorithm lc804唯一摩尔斯密码词 简单遍历翻译,然后放入集合,最终返回集合的size 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 class Solution { unordered_set<string> mos_set; public: int uniqueMorseRepresentations(vector<string>& words) { string s[] = {".-","-...","-.-.","-..",".","..-.","--.","....","..",".---","-.-",".-..","--","-.","---",".--.","--.-",".-.","...","-","..-","...-",".--","-..-","-.--","--.."};
Algorithm lc744_寻找比目标字母大的最小字母 直接特判z,然后其他的顺序寻找就行 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 class Solution { public: char nextGreatestLetter(vector<char>& letters, char target) {