![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
LeetCode
文章平均质量分 50
Drscq
STRIVE FOR MY DREAM
展开
-
【无标题】
在这篇博客文章中,我们将探讨LeetCode问题“42.接雨水”的解决方案。给定n个非负整数,表示一个高程图,其中每个条的宽度为1,目标是计算下雨后它能捕获多少水。原创 2023-05-12 22:28:08 · 406 阅读 · 0 评论 -
459. Repeated Substring Pattern
s。原创 2023-03-19 16:11:15 · 309 阅读 · 0 评论 -
28. Find the Index of the First Occurrence in a string
Given two strings and , return the index of the first occurrence of in , or -1 if is not part of .Example 1:Input: = “sadbutsad”, = “sad”Output: 0Explanation: “sad” occurs at index 0 and 6. The first occurrence is at index 0, so we return 0.Example原创 2023-03-19 10:09:09 · 379 阅读 · 0 评论 -
26. Remove Duplicates from Sorted Array
【代码】26. Remove Duplicates from Sorted Array。原创 2023-03-14 10:11:24 · 177 阅读 · 0 评论 -
214. Shortest Palindrome
s。原创 2023-03-13 21:55:29 · 46 阅读 · 0 评论 -
206. Reverse Linked List
【代码】206. Reverse Linked List。原创 2023-02-04 21:54:08 · 58 阅读 · 0 评论 -
707. Design Linked List
【代码】707. Design Linked List。原创 2023-02-02 16:49:22 · 160 阅读 · 0 评论 -
1005 Maximize Sum of Array After K Negations
【代码】1005 Maximize Sum of Array After K Negations。原创 2023-02-01 22:30:45 · 47 阅读 · 0 评论 -
Leetcode 455. Assign Cookies
【代码】Leetcode 455. Assign Cookies。原创 2023-01-20 12:14:56 · 1280 阅读 · 0 评论 -
The Two Ways to Handle the Backpacking Problem
【代码】The Two Ways to Handle the Backpacking Problem。原创 2022-12-08 22:12:30 · 95 阅读 · 0 评论 -
【无标题】
给你一个由不同字符组成的字符串 allowed 和一个字符串数组 words。如果一个字符串的每一个字符都在 allowed 中,就称这个字符串是 一致字符串。请你返回 words 数组中 一致字符串 的数目。输入:allowed = “ab”, words = [“ad”,“bd”,“aaab”,“baa”,“badab”]解释:字符串 “aaab” 和 “baa” 都是一致字符串,因为它们只包含字符 ‘a’ 和 ‘b’。原创 2022-11-08 11:05:06 · 66 阅读 · 0 评论 -
257 Binary Tree Paths
【代码】257 Binary Tree Paths。原创 2022-09-05 11:48:51 · 82 阅读 · 0 评论 -
203. Remove Linked List Elements
【代码】203. Remove Linked List Elements。原创 2022-08-22 21:51:49 · 187 阅读 · 1 评论 -
6152. Minimum Hours of Training to Win a Competition
You are entering a competition, and are given two positive integers initialEnergyinitialEnergyinitialEnergy and initialExperienceinitialExperienceinitialExperience denoting your initial energy and initial experience respectively.You are also given two 0-i原创 2022-08-21 21:12:07 · 114 阅读 · 0 评论 -
1302. Deepest Leaves Sum
Given the rootrootroot of a binary tree, return the sum of values of its deepest leaves.an exampleThe DFS and directly return the last layer sum of valuesBFS with log all the sum of values for every layersThe corresponding results原创 2022-08-18 22:49:32 · 67 阅读 · 0 评论 -
977. Squares of a Sorted Array
Given an integer array numsnumsnums sorted in non-decreasing order, return an array of the squares of each number sorted in non-decreasing order.exampleInput: nums=[−4,−1,0,3,10]nums = [-4, -1, 0, 3, 10]nums=[−4,−1,0,3,10]Output: [0,1,9,16,100][0, 1, 9,原创 2022-08-17 19:57:08 · 78 阅读 · 0 评论 -
27. Remove Element
Given an integer array nums and an integer val, remove all occurrences of val in nums in-place. The relative order of the elements may be changed.Since it is impossible to cyouhange the length of the array in some languages, you must instead have the re原创 2022-08-14 21:25:09 · 116 阅读 · 0 评论 -
344. Reverse String
Write a function that reverses a string. The input string is given as an array of characters s.You must do this by modifying the input array in-place with constant extra memory.An example:Input: s = [‘h’, ‘e’, ‘l’, ‘l’, ‘o’]Output: [‘o’, ‘l’, ‘l’, ‘e’,原创 2022-08-13 22:04:16 · 129 阅读 · 0 评论 -
640.Solve the Equation
Solve a given equation and return the value of in the form of a string . The equation contains only operation, the variable and its coefficient. You should return if there is no solution for the equation, or if there are infinite solutions for the e原创 2022-08-12 21:51:36 · 220 阅读 · 0 评论 -
1413.Minimum Value to Get Positive Step by Step Sum
代码】1413.Minimum Value to Get Positive Step by Step Sum。原创 2022-08-09 09:55:13 · 115 阅读 · 0 评论 -
Spiral Matrix
Given a n×nn \times nn×n matrix, output its elements in spiral and chronological order.The codes for the second problemconclusionknow your variables and use them correctly.原创 2022-08-06 20:18:01 · 66 阅读 · 0 评论 -
1161. Maximum Level Sum of a Binary Tree
代码】1161.MaximumLevelSumofaBinaryTree。原创 2022-08-02 16:14:53 · 76 阅读 · 0 评论 -
The Solution for Fibonacci from simple to complicated
F(0)=0,F(1)=1F(0) = 0, F(1) = 1F(0)=0,F(1)=1F(n)=F(n−1)+F(n−2),forn>1.F(n) = F(n - 1) + F(n - 2), for n > 1.F(n)=F(n−1)+F(n−2),forn>1.在这里插入图片描述](https://img-blog.csdnimg.cn/d5acb07170554d98b8b90c65741b2e7a.png)原创 2022-07-11 11:42:46 · 81 阅读 · 0 评论 -
648. Replace Words
an exampleSolution 1the intuitionspliet the sentence into wordscheck whether each word need to be changed or not.merge all the processed word into sentenceThe codes for thisthe corresponding resultsThe corresponding results原创 2022-07-09 09:29:00 · 58 阅读 · 0 评论 -
1200.Minimum Absolute Difference
an exampleThe solution 1The intuitionThe corresponding codesThe resultThe corresponding resultsThe corresponding result原创 2022-07-06 10:10:33 · 90 阅读 · 0 评论 -
241. Different Ways to Add Parentheses
The recursive methods the implementation of binary tree原创 2022-07-01 14:39:28 · 87 阅读 · 0 评论 -
1175. Prime Arrangements
an example原创 2022-06-30 10:16:17 · 95 阅读 · 0 评论 -
515. Find Largest Value in Each Tree Row
The first time pass the code in once time原创 2022-06-24 22:10:22 · 62 阅读 · 0 评论 -
513. Find Bottom Left Tree Value
an example原创 2022-06-23 09:03:11 · 98 阅读 · 0 评论 -
508. Most Frequent Subtree Sum
an exampleThe intuition for this problemThe corresponding codesThe result原创 2022-06-20 09:25:09 · 51 阅读 · 0 评论 -
剑指 Offer II 029. 排序的循环链表
an example原创 2022-06-19 07:42:30 · 54 阅读 · 0 评论 -
1089. Duplicate Zeros
an example原创 2022-06-17 22:52:20 · 125 阅读 · 0 评论 -
719. Find K-th Smallest Pair Distance
This codes are composed by sort and binary finding原创 2022-06-15 20:13:48 · 63 阅读 · 0 评论 -
498. Diagonal Traverse
二、The solutionssolution 1The corresponding resultssolution 2 failurecodes are follows:The corresponding resultsI am proud of myself.原创 2022-06-15 10:51:46 · 83 阅读 · 0 评论 -
1051. Height Checker
Bubble sort原创 2022-06-13 20:41:11 · 122 阅读 · 1 评论 -
890. Find and Replace Pattern
an exampleThe codes for above problemThe corresponding results原创 2022-06-12 20:43:50 · 85 阅读 · 0 评论 -
926. Flip String to Monotone Increasing
an example原创 2022-06-11 20:46:22 · 51 阅读 · 0 评论 -
730.Count Different Palindromic Subsequences
Two sequences a1, a2. ⋯\cdots⋯ and b1, b2, ⋯\cdots⋯ are different if there is some iii for which ai !=!=!= bi.exampleThe intuition (dynamic programming)The codes;#The results原创 2022-06-11 09:54:59 · 77 阅读 · 0 评论 -
875. Koko Eating Bananas
an example原创 2022-06-08 11:24:49 · 64 阅读 · 0 评论 -
929. Unique Email Addresses
an example原创 2022-06-04 23:20:41 · 144 阅读 · 0 评论