leetcode weekly The 278th game of the week is really difficult, but you can still brush the inverted hash of simple sorting + traversal prefix and traversal string

๐Ÿ“– Content of this article: leetcode weekly The 278th game of the week is really difficult, but you can still brush simple sorting + traversal double pointer + prefix and sum ๐Ÿ“‘ Article column: leetcode weekly game punch in ๐Ÿ“† Last updated: January 23, 2022 leetcode weekly Game 277 of the week ๐Ÿ™Š Personal profile: a Junior Program ape who ...

Posted by goodluck4287 on Sun, 30 Jan 2022 13:02:13 +0100

6 questions to solve the monotonous stack problem

Next larger element 1 Title Link Maintain a monotonically decreasing stack, that is, when the traversal element is larger than the top element of the stack, save the result and pop up the top element of the stack In order to get the results in the order of subset array 1, we need to use hash table to establish mapping relationship when ...

Posted by Desai on Sun, 30 Jan 2022 08:33:26 +0100

Double pointer algorithm - Introduction to the algorithm

Double pointer algorithm - Introduction to the algorithm Overview of double pointer algorithm The double pointer algorithm should be a special traversal algorithm, which not only uses a single pointer to traverse, but uses double pointers. Note that the pointer here does not refer to pointers such as int *ptr. The double pointer algorithm can ...

Posted by clearstatcache on Sun, 30 Jan 2022 08:29:01 +0100

[Likou MySQL intensive exercise]

๐ŸŽˆ Write in front ๐Ÿ™‹โ€โ™‚๏ธ Hello everyone, I'm super dream. We all know that we have to deal with the database almost every day, whether in study or daily work. In order to better operate the database, our SQL knowledge reserve is essential. If you want to master SQL well, you must practice and study every day. Next, Xiaomeng will lead our p ...

Posted by SilveR316 on Sun, 30 Jan 2022 07:00:41 +0100

One article to solve the classic algorithm problem of linked list

Common questions about linked lists, such as: Get the last k element, get the element in the middle position, judge whether there is a ring in the linked list, judge the length of the ring, and problems related to the length and position. These problems can be solved through the flexible use of double pointers. Sword finger Offer 22 The ...

Posted by T2theC on Sat, 29 Jan 2022 20:39:08 +0100

7 questions to solve the binary search problem

The sequential array searches for a value The basic idea of binary search is that the search interval must be orderly In this paper, all search is based on the closed interval. At this time, the condition in while should be written as l < = R If you search by the open interval (r=nums.size()), the condition in while should be written ...

Posted by erax on Sat, 29 Jan 2022 17:59:15 +0100

Leetcode brush questions, simple + medium questions (issue 36)

catalogue Question 1: continuous subarrays and Question 2: continuous array Question 3: intersecting linked list Question 4: goals and objectives Question 5: weight of the last stone II Question 6: constructing rectangles Question 7: change II Question 8: complete square Question 9: different paths II Question 10: stone game Leetcod ...

Posted by opido on Sat, 29 Jan 2022 11:54:40 +0100

Leetcode array operation

q54 spiral matrix Title portal Problem solution Traverse each row and column layer by layer. The last element of each row or column is the beginning of the next column or row. Because the side length of the matrix in the topic is not necessarily equal, there will be one more row or column in the end, which can be handled separate ...

Posted by greenhorn666 on Sat, 29 Jan 2022 02:34:24 +0100

IndexTree and AC automata

catalogue IndexTree AC automata IndexTree Tree array or Binary Indexed Tree (English: Binary Indexed Tree), also named Fenwick tree after its inventor. Its original intention is to solve the calculation problem of Cumulative Frequency in data compression. Now it is mostly used to efficiently calculate the prefix sum, interval sum of ...

Posted by JetJagger on Fri, 28 Jan 2022 20:10:05 +0100

Basic problems of binary tree in classic force deduction

preface: The vast majority of binary tree problems can be solved by recursion. Mastering the first, middle and last sequence traversal and sequence traversal of binary tree is the basis for quickly solving binary tree problems. catalogue preface: Maximum depth of binary tree Idea: code: Same tree Idea: code: Symmetric binary tree Ide ...

Posted by Disgone on Fri, 28 Jan 2022 19:27:45 +0100