Solutions to the 283 Weekly Match
This topic is not difficult, but there is still something to learn to write simple and elegant code.
Topic 1
Force buckle
ย
class Solution:
def cellsInRange(self, s: str) -> List[str]:
ans = []
a,b,c,d = s[0],s[1],s[3],s[4]
for i in range(ord(a), ord(c)+1):
for j in range(int(b),int(d)+1):
...
Posted by ShadowX on Sun, 06 Mar 2022 18:14:37 +0100
leetcode questions: the second week
Catalogue of series articles
leetcode: Week 1 leetcode questions: the second week
Tip: after writing the article, the directory can be generated automatically. For how to generate it, please refer to the help document on the right
preface
leetcode questions: the second week
Day 1 (breadth first search / depth first search)
1. Im ...
Posted by nyy2000 on Sun, 06 Mar 2022 13:39:06 +0100
2022-03-06 swipe questions and punch in every day
2022-03-06 swipe questions and punch in every day
Source code - div2 daily question
Path count - topic - Daimayuan Online Judge
There is an n ร N grid, some grids are passable, and some grids are obstacles.
At the beginning of your position in the upper left corner, you can go down or right every step and ask how many options there ar ...
Posted by mshen on Sun, 06 Mar 2022 13:37:26 +0100
leetcode weekly The 283rd game of Zhou Sai an Xian's quantization ~ simulation + mathematical calculation is really numb
๐ Content of this article: leetcode weekly Game 283 of Zhou Sai an Xian quantization ~ simulation + mathematical calculation ๐ Article column: leetcode weekly game punch in ๐ Last updated: February 27, 2022 leetcode weekly Game 282 of the week race grape City special session of the week race ~ simple simulation + application of hash tab ...
Posted by michaellunsford on Sun, 06 Mar 2022 09:38:42 +0100
LeetCode question brushing record
Sword finger Offer 30 Stack containing min function
Use the auxiliary value s2 to store the minimum value. If there is one smaller than s2, let the smaller value enter s2. When the minimum value in the original s1 comes out of the stack, judge that if it is equivalent to the s2 value, it means that the minimum value needs to be updated, then t ...
Posted by skroks609 on Sun, 06 Mar 2022 08:32:08 +0100
8 minutes to learn the longest common subsequence (with C + + source code, the one that runs directly)
Algorithm is really wonderful. It's easy to be addicted after learning. Of course, it's said on a simple premise. If I encounter that kind of problem, I also have a headache.
Today's plot is still the form of dialogue between teachers and students. In this way, I think it is more gradual and less abrupt. What do you think?
Now, students, let' ...
Posted by dragon_sa on Sat, 05 Mar 2022 21:52:52 +0100
Summary of double finger needling -- Taking LeetCode 27, 977, 15 and 18 as examples
The initial brush force deduction starts from the foundation, and the double pointer method is widely used in basic problems.
LeetCode 27, 977, 15 and 18 are the problems I have done in recent days, which can be well solved by double pointer method:
27:
It is equivalent to dividing the array into two parts: the first part is the valid p ...
Posted by reinmedia on Sat, 05 Mar 2022 13:45:24 +0100
LeetCode -- string (python language)
LeetCode -- string (python language)
1, String
1.1 string definition
A string is a concatenation of a series of characters. The string can be traversed, and each traversal is a character.
1.2 string matching
First, we call the string to be matched (long) as the main string, and the string to be matched (short) as the sub string (pattern st ...
Posted by deadimp on Sat, 05 Mar 2022 11:50:54 +0100
LeetCode problem brushing -- dynamic programming (python language)
LeetCode problem brushing -- dynamic programming (python language)
1, Dynamic programming
1.1 basic concepts
Dynamic programming algorithms are usually used to solve problems with some optimal properties. In such problems, there may be many feasible solutions. Each solution corresponds to a value. We want to find the solution with the optima ...
Posted by Thomisback on Sat, 05 Mar 2022 11:46:18 +0100
599. Minimum index sum of two lists
Address:
Force bucklehttps://leetcode-cn.com/problems/minimum-index-sum-of-two-lists/
Title:
Suppose Andy and Doris want to choose a restaurant for dinner, and they both have a list of favorite restaurants. The name of each restaurant is represented by a string.
You need to help them use the least index and find their favorite restaurants. ...
Posted by cuteflower on Sat, 05 Mar 2022 07:11:10 +0100