自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(358)
  • 收藏
  • 关注

原创 828. Count Unique Characters of All Substrings of a Given String

leetcode

2022-08-02 10:50:01 207 1

原创 leetcode 926. Flip String to Monotone Increasing

leetcode

2022-08-01 04:14:23 252

原创 2130. Maximum Twin Sum of a Linked List

leetcode

2022-07-31 02:58:26 210

原创 Leetcode 1567. Maximum Length of Subarray With Positive Product

leetcode

2022-07-28 13:04:36 125

原创 Leetcode 1268. Search Suggestions System

leetcode

2022-07-27 13:46:02 1416

原创 leetcode 937. Reorder Data in Log Files

leetcode

2022-07-26 10:07:04 178

原创 leetcode 2104. Sum of Subarray Ranges

leetcode

2022-07-25 10:30:16 135

原创 907. Sum of Subarray Minimums

leetcode

2022-07-25 10:21:57 251

原创 Leetcode 208. Implement Trie (Prefix Tree)

leetcode

2022-07-17 03:47:09 86

原创 leetcode 939. Minimum Area Rectangle

leetcode

2022-07-14 09:00:46 126

原创 Compute IOU and Non Maximum Suppression in numpy

computer vision

2022-07-13 14:11:28 125

原创 Leetcode 818. Race Car

leetcode

2022-07-13 12:39:03 307

原创 Leetcode 833. Find And Replace in String

leetcode

2022-07-12 10:04:39 99

原创 leetcode 2013. Detect Squares

leetcode

2022-07-12 08:44:30 132

原创 leetcode 703. Kth Largest Element in a Stream

leetcode

2022-07-10 12:00:09 115

原创 Leetcode 1146. Snapshot Array

leetcode

2022-07-08 11:47:13 202

原创 Leetcode 2135. Count Words Obtained After Adding a Letter

leetcode

2022-07-08 11:38:37 109

原创 leetcode 127. Word Ladder

leetcode

2022-07-05 04:30:39 137

原创 Leetcode 1048. Longest String Chain

leetcode

2022-07-05 04:26:29 146

原创 leetcode 1937. Maximum Number of Points with Cost

leetcode

2022-07-04 03:40:13 131

原创 Leetcode https://leetcode.com/problems/minimum-falling-path-sum/

leetcode

2022-07-04 03:26:59 62

原创 Leetcode 115. Find All Possible Recipes from Given Supplies

leetcode

2022-07-01 09:17:48 87

原创 Leetcode 2034. Stock Price Fluctuation

leetcode

2022-07-01 08:18:44 149

原创 Leetcode 366. Find Leaves of Binary Tree

leetcode 树

2022-06-29 11:55:58 153

原创 leetcode 2096. Step-By-Step Directions From a Binary Tree Node to Another

leetcode

2022-06-28 13:32:52 984

原创 leetcode 2305. Fair Distribution of Cookies

leetcode

2022-06-23 12:50:14 535

原创 leetcode 2304. Minimum Path Cost in a Grid

leetcode

2022-06-23 12:45:39 123

原创 Leetcode 2303. Calculate Amount Paid in Taxes

leetcode

2022-06-23 12:40:14 93

原创 leetcode 1162. As Far from Land as Possible

leetcode

2022-06-14 11:09:04 113

原创 Leetcode 2275. Largest Combination With Bitwise AND Greater Than Zero

题目错误解法:一开始想用backtracking来解,但是发现用memorization比较困难,于是当然是tle的,解法如下class Solution {public: int helper(vector<int>& nums, int ind, int curr){ if(ind == nums.size()) return 0; int res = 0; int tmp = curr; for(in

2022-05-23 09:36:35 151

原创 Leetcode 2274. Maximum Consecutive Floors Without Special Floors

题目解法:排序class Solution {public: int maxConsecutive(int bottom, int top, vector<int>& special) { sort(special.begin(),special.end()); if(bottom != special[0]) special.insert(special.begin(),bottom-1); if(top != speci

2022-05-23 09:17:33 99

原创 Leetcode 2273. Find Resultant Array After Removing Anagrams

题目解法:class Solution {public: void get_ana(vector<int>& ana,string word){ for(auto& c : word){ ana[c-'a']++; } } vector<string> removeAnagrams(vector<string>& words) { vector&

2022-05-23 09:14:17 183

原创 Leetcode 2280. Minimum Lines to Represent a Line Chart

题目解法这道题并不难,但是题目讲的不是特别清楚。题目的隐含条件是每个点只能与相邻的节点连接,如果是这样就比较好做了,需要注意的一点是,给的数据并不会按照日期来进行排序,需要先进行排序另外一点是,利用减法会比较好做,n个点最多n+1条线,如果有某个点在之前的线上,那么总数减掉一条,在这边只需判断相邻三个点的共线性就可以了但是有两个注意点:1. 这道题有一个比较关键的点是,计算两个斜率是不是相等,如果直接dy1/dx1 == dy2/dx2,很有可能会出现精度问题,所以利用交叉相乘判断是最好的选

2022-05-23 09:04:17 73

原创 Leetcode 2279. Maximum Bags With Full Capacity of Rocks

题目解法:贪心将袋子的剩余空间从小到大的排序,greedy的填满袋子即可class Solution {public: int maximumBags(vector<int>& capacity, vector<int>& rocks, int additionalRocks) { int n = capacity.size(); vector<int> remain(n,0); for(

2022-05-23 08:32:02 239

原创 Leetcode 2278. Percentage of Letter in String

题目解法:class Solution {public: int percentageLetter(string s, char letter) { int cnt = 0; for(auto& c : s){ if(c == letter) cnt++; } return (cnt*100) / s.size(); }};

2022-05-23 08:28:48 59

原创 Leetcode 2278. Percentage of Letter in String

题目解法:class Solution {public: int percentageLetter(string s, char letter) { int cnt = 0; for(auto& c : s){ if(c == letter) cnt++; } return (cnt*100) / s.size(); }};

2022-05-23 08:27:56 81

原创 Leetcode 2278. Percentage of Letter in String

题目解法:class Solution {public: int percentageLetter(string s, char letter) { int cnt = 0; for(auto& c : s){ if(c == letter) cnt++; } return (cnt*100) / s.size(); }};

2022-05-23 08:26:09 42

原创 Leetcode 630. Course Schedule III

题目解法:greedy+heap总体思路是优先greedy的选择结束时间早的课程来进行完成,这样能保证完成最多的课程将所有课程按照结束时间来排序遍历每一节课,假设上了这节课,如果加完当前这节课发现不满足当前的end时间,那么就从选的课里面去掉一节时间最长的课程,最长的课程有可能是现在这节课,也有可能是之前的课程,这样就能时间重新满足条件,这个时候就是对于遍历到现在的课程的最优解。同时因为会移除时间最长的那节课,就保证了之后的课程会有更多的时间注意:python的heapq默认是小根堆,需要改变

2022-05-19 09:39:58 180

原创 Leetcode 1087. Brace Expansion

题目Descriptionhttps://leetcode.com/problems/brace-expansion/You are given a string s representing a list of words. Each letter in the word has one or more options.If there is one option, the letter is represented as is.If there is more than one option,

2022-05-15 07:50:44 209

原创 Leetcode 2265. Count Nodes Equal to Average of Subtree

题目解法:递归返回值分别代表·{以当前节点作为根节点的子树所有数字和,符合条件的节点个数,以当前节点作为根节点的子树的节点总数}class Solution {public: vector<int> helper(TreeNode* node){ if(!node) return {0,0,0}; if(!node->left && !node->right) return {node->val,1,1};

2022-05-15 01:54:34 149

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除