摘要:problem 1137. N-th Tribonacci Number solution: 参考 1. Leetcode_easy_1137. N-th Tribonacci Number; 完
阅读全文
摘要:https://www.jianshu.com/p/f6f49f6bcea6 https://github.com/BVLC/caffe/tree/master/include/caffe/layers 其中,常用的Interp层是自定义层,可参考PSPNet;
阅读全文
摘要:problem 961. N-Repeated Element in Size 2N Array solution: 参考 1. Leetcode_easy_961. N-Repeated Element in Size 2N Array; 完
阅读全文
摘要:problem 953. Verifying an Alien Dictionary solution: 参考 1. Leetcode_easy_953. Verifying an Alien Dictionary; 2. dicuss; 完
阅读全文
摘要:problem 949. Largest Time for Given Digits solution: 参考 1. Leetcode_easy_949. Largest Time for Given Digits; 2. discuss; 3. cplusplus_prev_permutation
阅读全文
摘要:problem 944. Delete Columns to Make Sorted 题意:其实题意很简单,但是题目的description给整糊涂啦。。。直接看题目标题即可理解。 solution: 参考 1. Leetcode_easy_944. Delete Columns to Make S
阅读全文
摘要:problem 942. DI String Match 参考 1. Leetcode_easy_942. DI String Match; 完
阅读全文
摘要:problem 938. Range Sum of BST 参考 1. Leetcode_easy_938. Range Sum of BST; 完
阅读全文
摘要:problem 941. Valid Mountain Array solution: solution2: 参考 1. Leetcode_easy_941. Valid Mountain Array; 2. discuss_climb_mountain; 完
阅读全文
摘要:problem 937. Reorder Log Files solution: 参考 1. Leetcode_easy_937. Reorder Log Files; 2. discuss1_conpare; 3. discuss2_sort; 4. discuss3_moveback; 完
阅读全文
摘要:problem 933. Number of Recent Calls 参考 1. Leetcode_easy_933. Number of Recent Calls; 完
阅读全文
摘要:problem 929. Unique Email Addresses solution: 参考 1. Leetcode_easy_929. Unique Email Addresses; 完
阅读全文
摘要:problem 876. Middle of the Linked List 参考 1. Leetcode_easy_876. Middle of the Linked List; 完
阅读全文
摘要:problem 883. Projection Area of 3D Shapes 参考 1. Leetcode_easy_883. Projection Area of 3D Shapes; 完
阅读全文
摘要:problem 884. Uncommon Words from Two Sentences 题意:只要在两个句子中单词出现总次数大于1次即可。 注意掌握istringstream/map/set的使用方法。 solution: 参考 1. Leetcode_easy_884. Uncommon W
阅读全文
摘要:problem 892. Surface Area of 3D Shapes 题意:感觉不清楚立方体是如何堆积的,所以也不清楚立方体之间是如何combine的。。 Essentially, compute the surface area of each grid but substract the
阅读全文
摘要:problem 888. Fair Candy Swap solution: 参考 1. Leetcode_easy_888. Fair Candy Swap; 2. discuss; 3. grandyang; 完
阅读全文
摘要:problem 893. Groups of Special-Equivalent Strings 题意: 感觉参考代码也是有点问题的。。。 参考 1. Leetcode_easy_893. Groups of Special-Equivalent Strings; 2. grandyang; 3.
阅读全文
摘要:problem 896. Monotonic Array solution1: solution2: 参考 1. Leetcode_easy_896. Monotonic Array; 2. discuss1; 3. discuss2; 完
阅读全文
摘要:problem 897. Increasing Order Search Tree 参考 1. Leetcode_easy_897. Increasing Order Search Tree; 完
阅读全文
摘要:problem 905. Sort Array By Parity solution1: solution2: 参考 1. Leetcode_easy_905. Sort Array By Parity; 2. discuss; 完
阅读全文
摘要:problem 914. X of a Kind in a Deck of Cards 题意:每个数字对应的数目可以均分为多组含有K个相同数目该数字的数组。 思路:使用 map 结构记录数组中每个元素出现的次数,该题转化为求次数的最大公约数,若所有次数的最大公约数大于或者等于 2,返回 true,否
阅读全文
摘要:problem 908. Smallest Range I solution: 参考 1. Leetcode_easy_908. Smallest Range I; 2. discuss; 完
阅读全文
摘要:problem 917. Reverse Only Letters solution: 参考 1. Leetcode_easy_917. Reverse Only Letters; 完
阅读全文
摘要:problem 922. Sort Array By Parity II solution1: 参考 1. Leetcode_easy_922. Sort Array By Parity II; 2. discuss; 完
阅读全文
摘要:problem 925. Long Pressed Name solution1: 参考 1. Leetcode_easy_925. Long Pressed Name; 2. discuss; 3. cnblogs; 完
阅读全文
摘要:problem 872. Leaf-Similar Trees 参考 1. Leetcode_easy_872. Leaf-Similar Trees; 完
阅读全文
摘要:problem 874. Walking Robot Simulation solution1: 思路:1)如何表示移动的方向以及移动的位置坐标; 2)障碍物坐标如何检查;3)求解的是最大距离; 参考 1. Leetcode_easy_874. Walking Robot Simulation; 2
阅读全文
摘要:problem 1128. Number of Equivalent Domino Pairs solution1: 不明白为什么每个元素都要加上count; 参考 1. Leetcode_easy_1128. Number of Equivalent Domino Pairs; 2. Discus
阅读全文
摘要:工程编译遇到的问题: 如下图所示: 解决方法: step1: 主要是opencv的相关配置还是有问题的,首先按照软件说明文档中opencv部分的使用说明进行操作,还需要按照软件最新给出的opencv第三方库的readme文档配置opencv工程的属性,即可; step2: 代码中调用摄像头的语句:
阅读全文
摘要:problem 868. Binary Gap solution1: solution2: 参考1. Leetcode_easy_868. Binary Gap; 2. Grandyang; 完
阅读全文
摘要:problem 867. Transpose Matrix solution: 参考 1. Leetcode_easy_867. Transpose Matrix; 2. Grandyang; 完
阅读全文
摘要:problem 860. Lemonade Change solution 参考 1. Leetcode_easy_860. Lemonade Change; 2. Discuss; 3. Grandyang; 完
阅读全文
摘要:problem 859. Buddy Strings solution: 参考 1. Leetcode_easy_859. Buddy Strings; 2. grandyang; 3. Discuss; 完
阅读全文
摘要:problem 852. Peak Index in a Mountain Array solution1: solution2: solution3: 参考 1. Leetcode_easy_852. Peak Index in a Mountain Array; 2. grandyang; 3.
阅读全文
摘要:problem 849. Maximize Distance to Closest Person solution1: 参考 1. Leetcode_easy_849. Maximize Distance to Closest Person; 2. grandyang; 完
阅读全文
摘要:problem 844. Backspace String Compare solution1: solution2: 参考1. Leetcode_easy_844. Backspace String Compare; 2. grandyang; 完
阅读全文
摘要:problem 840. Magic Squares In Grid solution: 参考 1. Leetcode_easy_840. Magic Squares In Grid; 2. grandyang; 完
阅读全文
摘要:problem 836. Rectangle Overlap solution: 参考 1. Leetcode_easy_836. Rectangle Overlap; 2. grandyang; 完
阅读全文
摘要:problem 830. Positions of Large Groups solution1: 参考 1. Leetcode_easy_830. Positions of Large Groups; 2. grandyang; 完
阅读全文
摘要:problem 832. Flipping an Image solution1: 参考1. Leetcode_easy_832. Flipping an Image; 2. grandyang; 完
阅读全文
摘要:problem 824. Goat Latin solution 参考 1. Leetcode_easy_824. Goat Latin; 2. grandyang; 3. discuss; 完
阅读全文
摘要:problem 821. Shortest Distance to a Character solution1: solution2: 参考 1. Leetcode_easy_821. Shortest Distance to a Character; 2. Discuss; 3. grandyan
阅读全文
摘要:problem 819. Most Common Word solution: 参考 1. Leetcode_easy_819. Most Common Word; 2. Grandyang; 3. Discuss; 完
阅读全文
摘要:problem 812. Largest Triangle Area solution: 参考 1. Leetcode_easy_812. Largest Triangle Area; 2. Grandyang; 完
阅读全文
摘要:problem 811. Subdomain Visit Count solution: 参考 1. Leetcode_easy_811. Subdomain Visit Count; 2. Grandyang; 完
阅读全文
摘要:problem 806. Number of Lines To Write String solution: 参考 1. Leetcode_easy_806. Number of Lines To Write String; 2. Grandyang; 完
阅读全文
摘要:problem 804. Unique Morse Code Words solution1: 参考 1. Leetcode_easy_804. Unique Morse Code Words; 2. Grandyang; 完
阅读全文
摘要:problem 796. Rotate String solution1: solution2: 参考 1. Leetcode_easy_796. Rotate String; 2. Grandyang; 完
阅读全文
摘要:problem 788. Rotated Digits solution1: 参考 1. Leetcode_easy_788. Rotated Digits; 2. Grandyang; 完
阅读全文
摘要:problem 784. Letter Case Permutation 参考 1. Leetcode_easy_784. Letter Case Permutation; 2. Grandyang; 完
阅读全文
摘要:problem 783. Minimum Distance Between BST Nodes 参考 1. Leetcode_easy_783. Minimum Distance Between BST Nodes; 完
阅读全文
摘要:problem 771. Jewels and Stones solution1: 参考 1. Leetcode_easy_771. Jewels and Stones; 2. Grandyang; 完
阅读全文
摘要:problem 766. Toeplitz Matrix solution1: 参考 1. Leetcode_easy_766. Toeplitz Matrix; 2. Grandyang; 完
阅读全文
摘要:problem 1122. Relative Sort Array 参考 1. Leetcode_easy_1122. Relative Sort Array; 2. helloacm; 完
阅读全文
摘要:problem 1078. Occurrences After Bigram 题意 solution: 参考 1. Leetcode_easy_1078. Occurrences After Bigram; 2. string_find; 3. discuss; 4. string_substr;
阅读全文
摘要:problem 762. Prime Number of Set Bits in Binary Representation solution1: solution2:题目中给了数的大小范围 R <= 106 < 220,那么统计出来的非零位个数cnt只需要检测是否是20以内的质数即可,所以将20以
阅读全文
摘要:problem 748. Shortest Completing Word 题意: solution1: class Solution { public: string shortestCompletingWord(string licensePlate, vector<string>& words
阅读全文
摘要:problem 754. Reach a Number solution1: solution2: solution3:solution1的精简版; 参考 1. Leetcode_easy_754. Reach a Number; 2. Grandyang; 完
阅读全文
摘要:problem 747. Largest Number At Least Twice of Others 题意: solution1: solution2: 参考 1. Leetcode_easy_747. Largest Number At Least Twice of Others; 2. Gr
阅读全文
摘要:problem 1089. Duplicate Zeros 题意: solution: 其中关于虚拟新数组的下标的计算还是有点迷糊。。。 参考 1. Leetcode_easy_1089. Duplicate Zeros; 2. discuss; 完
阅读全文
摘要:problem 1103. Distribute Candies to People solution:没看明白代码。。。 参考 1. Leetcode_easy_1103. Distribute Candies to People; 2. Discuss; 完
阅读全文
摘要:problem 1108. Defanging an IP Address solution: 参考 1. Leetcode_easy_1108. Defanging an IP Address; 完
阅读全文
摘要:problem 746. Min Cost Climbing Stairs 题意: solution1:动态规划; 定义一个一维的dp数组,其中dp[i]表示爬到第i层的最小cost,然后来想dp[i]如何推导。思考一下如何才能到第i层呢?是不是只有两种可能性,一个是从第i-2层上直接跳上来,一个是
阅读全文
摘要:problem 744. Find Smallest Letter Greater Than Target 题意:一堆有序的字母,然后又给了一个target字母,让求字母数组中第一个大于target的字母,数组是循环的,如果没有,那就返回第一个字母。 solution1:注意数组已经是有序数组啦。。
阅读全文
摘要:problem 733. Flood Fill 题意:图像处理中的泛洪填充算法,常见的有四邻域像素填充法、八邻域像素填充法、基于扫描线的像素填充法,实现方法分为递归与非递归(基于栈)。 泛洪填充算法原理:从某个像素点开始,将封闭区域内的所有此像素值位置的元素填充为新颜色。 solution1: 递归
阅读全文
摘要:problem 728. Self Dividing Numbers solution1: 使用string类型来表示每位上的数字; solution2: 使用数学计算来check每一个数字; 问题1:求解余数的语句; 问题2:需要先求解一次余数,再计算除数,即下一次计算需要用到的被除数。 参考 1
阅读全文
摘要:problem 724. Find Pivot Index 题意:先求出数组的总和,然后维护一个当前数组之和curSum,然后对于遍历到的位置,用总和减去当前数字,看得到的结果是否是curSum的两倍,是的话,那么当前位置就是中枢点,返回即可;否则就将当前数字加到curSum中继续遍历,遍历结束后还
阅读全文
摘要:problem 720. Longest Word in Dictionary 题意: solution1: BFS; solution2: 参考 1. Leetcode_easy_720. Longest Word in Dictionary; 2. Grandyang; 完
阅读全文
摘要:problem 717. 1-bit and 2-bit Characters 题意:solution1: solution2:根据数组的特性计算。 参考 1. Leetcode_easy_717. 1-bit and 2-bit Characters; 2. Grandyang; 完
阅读全文
摘要:problem 709. To Lower Case solution1: solution2: 参考 1. Leetcode_easy_709. To Lower Case; 2. Grandyang; 完
阅读全文
摘要:problem 707. Design Linked List 参考 1. Leetcode_easy_707. Design Linked List; 完
阅读全文
摘要:problem 706. Design HashMap solution1: solution2: 参考 1. Leetcode_easy_706. Design HashMap; 2. Grandyang; 完
阅读全文
摘要:problem 705. Design HashSet 题意: solution1: solution2: 参考 1. Leetcode_easy_705. Design HashSet; 2. Grandyang; 完
阅读全文
摘要:problem 704. Binary Search solution: 参考 1. Leetcode_easy_704. Binary Search; 完
阅读全文