摘要:problem 558. Quad Tree Intersection re 1. Leetcode_easy_558. Quad Tree Intersection; 2. Grandyang; end
阅读全文
摘要:problem 557. Reverse Words in a String III solution1:字符流处理类istringstream. solution2:单词首尾指针。 参考 1. Leetcode_easy_557. Reverse Words in a String III; 2.
阅读全文
摘要:problem 551. Student Attendance Record I 题意: solution: 理解题意很简单,重要的是其中的逻辑怎么实现。还有一点需要注意自加自减运算,感觉还是有点不熟练。。 参考 1. Leetcode_easy_551. Student Attendance Re
阅读全文
摘要:problem 543. Diameter of Binary Tree 题意: 转换一种角度来看,是不是其实就是根结点1的左右两个子树的深度之和呢。那么我们只要对每一个结点求出其左右子树深度之和,这个值作为一个候选值,然后再对左右子结点分别调用求直径对递归函数,这三个值相互比较,取最大的值更新结果
阅读全文
摘要:problem 541. Reverse String II 题意: 给定一个字符串,每隔k个字符翻转这k个字符,剩余的小于k个则全部翻转,否则还是只翻转剩余的前k个字符。 solution1: solution2: 简洁版 就是每2k个字符来遍历原字符串s,然后进行翻转,翻转的结尾位置是取i+k和
阅读全文
摘要:problem 538. Convert BST to Greater Tree 参考 1. Leetcode_easy_538. Convert BST to Greater Tree; 完
阅读全文
摘要:problem 532. K-diff Pairs in an Array 题意:统计有重复无序数组中差值为K的数对个数。 solution1: 使用映射关系; 统计数组中每个数字的个数。我们可以建立每个数字和其出现次数之间的映射,然后遍历哈希表中的数字,如果k为0且该数字出现的次数大于1,则结果r
阅读全文
摘要://IHostMemory *gieModelStream {nullptr}; //const char* prototxt = "./googlenet/test_20181010.prototxt";//argv[1]; //const char* caffemodel = "./googlenet/lane_area_lx1890_iter_320000_20...
阅读全文
摘要:problem 530. Minimum Absolute Difference in BST 参考 1. Leetcode_easy_530. Minimum Absolute Difference in BST; 2. Grandyang_二叉搜索树的最小绝对差; 完
阅读全文
摘要:problem 521. Longest Uncommon Subsequence I 最长非共同子序列之一 题意: 两个字符串的情况很少,如果两个字符串相等,那么一定没有非共同子序列,反之,如果两个字符串不等,那么较长的那个字符串就是最长非共同子序列。 solution: or 参考 1. Lee
阅读全文
摘要:problem 520. Detect Capital 题意: 题目中给出的三种情况,分别是全是大写、全是小写、首字母大写,这三种情况返回True;否则返回False; solution: 参考 1. Leetcode_520. Detect Capital; 完
阅读全文
摘要:problem 509. Fibonacci Number solution1: 递归调用 solution2: 结果只与前两个数字有关。 solution3: 使用数组类型数据。 但是不知道哪里有问题,为什么一直没有通过。。。哪位大神看到知道原因的麻烦告知一下下哈~ 参考 1. Leetcode_
阅读全文
摘要:problem 507. Perfect Number solution: /* class Solution { public: bool checkPerfectNumber(int num) { int sum = 1; for(int i=2; i*i<=num; i++) { if(num
阅读全文
摘要:problem 506. Relative Ranks solution1:使用优先队列; 掌握priority_queue 和 pair的使用; solution2: 使用映射map; 参考 1. Leetcode_506. Relative Ranks; 完
阅读全文
摘要:problem 504. Base 7 solution: 参考 1. Leetcode_504. Base 7; 完
阅读全文
摘要:problem 501. Find Mode in Binary Search Tree 参考 1. Leetcode_501. Find Mode in Binary Search Tree; 完
阅读全文
摘要:problem 500. Keyboard Row 题意:判断给出的某个单词是否可以使用键盘上的某一行字母type得到; 注意大小写的转换; solution1: 使用set保存三行字符,查看每个字符所在的行数是否一致; SET: or: 判断每一行的字母数目是否与对应单词的长度一致; class
阅读全文
摘要:Q: for i in range(len(shape)/2):TypeError: 'float' object cannot be interpreted as an integer A: for i in range(len(shape)//2): 参考 1. https://blog.csd
阅读全文
摘要:前言 操作过程 NCNN: https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-linux-x86; vector初始化: int num[4] = { 1, 4, 3, 2 }; int numLength = sizeof(nu
阅读全文
摘要:前言 MTCNN是级联卷积网络,原理基本上比较清晰,只是还缺少实战,看到一个CSDN上windows的实现过程,就拿来试试。 操作过程 参考here,某些步骤会添加博主遇到的问题的解释。 参考 1. MTCNN的windows-cpu配置; 2. MTCNN_paper; 完
阅读全文
摘要:前言 使用CAN通信时将信号转换为char类型进行传输,要查看传输的信息是否正确需要将char类型数据以二进制格式输出; code 参考 1. 二进制格式输出char类型数据; 完
阅读全文
摘要:前言 系统程序一般需要读取参数文件,看到一个很好的Config类记录在此。 头文件Config.h //Config.h //re: https://blog.csdn.net/David_xtd/article/details/9320549 #pragma once #include <stri
阅读全文
摘要:problem: 496. Next Greater Element I 题意:求集合中每个数字在原数组中右边第一个较大的数字。 solution1: 暴力搜索; class Solution { public: vector<int> nextGreaterElement(vector<int>&
阅读全文