diff --git a/README.md b/README.md
index 102364b45..4353c362e 100644
--- a/README.md
+++ b/README.md
@@ -4,42 +4,42 @@
- [1004.Maximum continuity1Number III Maximum continuity1Number III](https://longsizhuo.github.io/post/ed19b576.html)
- [1017. Negative binary conversion](https://longsizhuo.github.io/post/dce95dce.html)
-- [1124. The longest period of performance One question daily](https://longsizhuo.github.io/post/a5d1dfda.html)
- [1017.Negative binary conversion](https://longsizhuo.github.io/post/80cafdc8.html)
+- [1124. The longest period of performance One question daily](https://longsizhuo.github.io/post/a5d1dfda.html)
- [1138. The path on the letter board One question daily](https://longsizhuo.github.io/post/fd471847.html)
-- [1233Delete the subfolder folder One question daily](https://longsizhuo.github.io/post/6610c769.html)
- [1139. The greatest 1 Formation of the border One question daily](https://longsizhuo.github.io/post/eb193c1f.html)
+- [1233Delete the subfolder folder One question daily](https://longsizhuo.github.io/post/6610c769.html)
- [1234. Replace the sub -string to get a balanced string One question daily](https://longsizhuo.github.io/post/56d97dcf.html)
- [1237. Find out the positive combination of the given square One question daily](https://longsizhuo.github.io/post/14b94db7.html)
- [1250. examine「Good array」 One question daily](https://longsizhuo.github.io/post/435a9a0d.html)
-- [142.Ring linkedII](https://longsizhuo.github.io/post/e2c9cca9.html)
- [1551. Make all the minimum operations of all elements in the array](https://longsizhuo.github.io/post/b2a927d5.html)
+- [142.Ring linkedII](https://longsizhuo.github.io/post/e2c9cca9.html)
- [1590.Make the array and energyPDivide](https://longsizhuo.github.io/post/59825e1f.html)
- [1604Warn alert person who uses the same employee card within one hour One question daily](https://longsizhuo.github.io/post/bb7bcf54.html)
- [1653. The minimum number of times to balance the string balance](https://longsizhuo.github.io/post/cac21f27.html)
- [1663. The smallest string with a given value One question daily](https://longsizhuo.github.io/post/4d7252f8.html)
+- [1664. Number of schemes to generate balance numbers One question daily](https://longsizhuo.github.io/post/1978f474.html)
- [1669. Merge two linked watches One question daily](https://longsizhuo.github.io/post/d482ac75.html)
- [1798You can construct the maximum number of continuity One question daily](https://longsizhuo.github.io/post/3667cd44.html)
- [1801-1803 Liech buckle novice!](https://longsizhuo.github.io/post/2f3e8e26.html)
-- [1664. Number of schemes to generate balance numbers One question daily](https://longsizhuo.github.io/post/1978f474.html)
- [1813. Sentence similarity III](https://longsizhuo.github.io/post/69c2a1dd.html)
- [1814. Statistics the number of good pairs in an array One question daily](https://longsizhuo.github.io/post/ceb1e67f.html)
- [1817. Find the number of users of users active One question daily](https://longsizhuo.github.io/post/d0a9337b.html)
- [1819.Different numbers in the sequence](https://longsizhuo.github.io/post/de522cea.html)
- [1825. Seek out MK average value](https://longsizhuo.github.io/post/6be57ef7.html)
-- [1828. Statistics the number of a circle mid -point One question daily](https://longsizhuo.github.io/post/3277549c.html)
- [1825. Seek out MK average value](https://longsizhuo.github.io/post/6be57ef7.html)
+- [1828. Statistics the number of a circle mid -point One question daily](https://longsizhuo.github.io/post/3277549c.html)
- [19.Delete the countdown of the linked listNNode](https://longsizhuo.github.io/post/c916b663.html)
- [PythonCoincidence,Random algorithmO(nlogn)Push](https://longsizhuo.github.io/post/a1d26db4.html)
- [2085. Public string that has occurred once](https://longsizhuo.github.io/post/bbe4bff6.html)
- [209.Small length array](https://longsizhuo.github.io/post/e6227611.html)
- [217. Existing duplicate elements C++/Python3](https://longsizhuo.github.io/post/717042a6.html)
- [217. Existing duplicate elements C++/Python3](https://longsizhuo.github.io/post/717042a6.html)
+- [219.Existing duplicate elements II Hash table graphics](https://longsizhuo.github.io/post/16b0e9f1.html)
- [221Maximum square](https://longsizhuo.github.io/post/e03edda.html)
- [One question daily 2283](https://longsizhuo.github.io/post/c3f7f59f.html)
-- [219.Existing duplicate elements II Hash table graphics](https://longsizhuo.github.io/post/16b0e9f1.html)
-- [One question daily 2299. Code inspection device II](https://longsizhuo.github.io/post/7ded25bb.html)
- [One question daily 2293. Great mini game](https://longsizhuo.github.io/post/9df6242c.html)
+- [One question daily 2299. Code inspection device II](https://longsizhuo.github.io/post/7ded25bb.html)
- [2303. Calculate the total taxable amount](https://longsizhuo.github.io/post/11597f8b.html)
- [2309. The best English letters with both appropriates and lowercases One question daily](https://longsizhuo.github.io/post/b4953d62.html)
- [2315. Statistical star number One question daily](https://longsizhuo.github.io/post/dc8d7590.html)
@@ -74,11 +74,11 @@
- [76Minimum cover string](https://longsizhuo.github.io/post/ae10d3c1.html)
- [Python beat98.40% collectionsofCounter method!](https://longsizhuo.github.io/post/73b5ce9c.html)
- [9021_TUT_1](https://longsizhuo.github.io/post/ac786f6f.html)
-- [9021_TUT_2](https://longsizhuo.github.io/post/becdc081.html)
-- [977.Orderly array square](https://longsizhuo.github.io/post/a386fcdc.html)
- [964E](https://longsizhuo.github.io/post/2280b647.html)
+- [977.Orderly array square](https://longsizhuo.github.io/post/a386fcdc.html)
- [994.Rotten orange](https://longsizhuo.github.io/post/56e64fdd.html)
- [Sword finger Offer 43. 1~n Integer 1 Number of times](https://longsizhuo.github.io/post/f0d96a1f.html)
+- [9021_TUT_2](https://longsizhuo.github.io/post/becdc081.html)
- [121.The best time for buying and selling stocks](https://longsizhuo.github.io/post/3a21fe32.html)
- [1222.Can attack the queen of the king](https://longsizhuo.github.io/post/a6577367.html)
- [122.The best time for buying and selling stocksII](https://longsizhuo.github.io/post/a75da5a.html)
@@ -100,9 +100,9 @@
- [LCP 50.Gem supply](https://longsizhuo.github.io/post/762ca698.html)
- [brief_alternate Assignment](https://longsizhuo.github.io/post/dbbd7d58.html)
- [GOlanguage# GOlanguage可爱捏](https://longsizhuo.github.io/post/67fc8613.html)
-- [Top of an article](https://longsizhuo.github.io/post/edc2b94.html)
- [Inline expansion](https://longsizhuo.github.io/post/2660e935.html)
- [Some doubt](https://longsizhuo.github.io/post/941aeb72.html)
+- [Top of an article](https://longsizhuo.github.io/post/edc2b94.html)
- [math](https://longsizhuo.github.io/post/a927044d.html)
- [Sword finger Offer 68 - II. The recent public ancestor of the binary tree](https://longsizhuo.github.io/post/36f314aa.html)
- [Sword finger Offer II 021. Delete the countdown of the linked list n Node](https://longsizhuo.github.io/post/3ed2f01c.html)
diff --git a/archives/2022/12/index.html b/archives/2022/12/index.html
index 1b4210cc6..15212ed2b 100644
--- a/archives/2022/12/index.html
+++ b/archives/2022/12/index.html
@@ -414,7 +414,7 @@
This exercise focuses on input validation and formatting floating-point numbers. The goal is to prompt the user to enter a floating-point number between -1 and 1 (exclusive). If the input is valid, the program rounds the number to two decimal places and prints it. Otherwise, it keeps prompting the user until a valid input is provided. Key Points:
The program uses a try-except block to catch invalid inputs (e.g., strings that cannot be converted to floats).
The input() function is wrapped in an infinite while loop to continuously ask for input until the correct condition is met.
In the updated version of Exercise 1, we use the formatting :.2f instead of round(). Here’s the key difference between the two:
round(): This is a Python built-in function that rounds a number to a specified number of decimal places. For example, round(1.236, 2) will return 1.24. However, the output of round() is still a float, but it does not guarantee a fixed number of decimal places when printed. For instance, round(1.0001, 2) would return 1.0 and only display one decimal place, not two.
:.2f: This is part of Python’s string formatting and ensures the number is displayed with exactly two decimal places, no matter what the number is. It also rounds the number appropriately. For instance, number = 1.0 formatted as f”{number:.2f}” will print 1.00. This makes :.2f particularly useful for consistent display of decimal places, which is important for formatting output for users.
1 2 3 4 5 6 7 8 9 10 11 12
whileTrue: try: i = input('Enter a floating point number between -1 and 1 excluded: ') number = float(i) if -1 < number < 1: # not using round() here because it rounds to the nearest even number print(f'\nUp to +/-0.005, you input {number:.2f}') else: raise ValueError break except ValueError: print("You got that wrong, try again!\n")
Exercise 2:
This exercise involves processing a block of text and formatting it into sentences. Each sentence should have its first word capitalized, and the remaining words should be in lowercase. The task is to handle spaces and punctuation properly.
Key Points:
A regular expression (re.sub) is used to replace multiple spaces with a single space.
Another regular expression (re.split) is used to split the text into sentences while preserving punctuation marks.
After splitting, the sentences are processed: the first word is capitalized, and all other words are made lowercase.
Finally, the processed sentences are recombined into a single formatted text.
Why use re in Exercise 2, and what is re?
In Exercise 2, we use re (Python’s regular expression module) to process and format the text input. Let’s break down why re is used and what it is:
What is re?
re stands for regular expressions, which are powerful tools for matching patterns in strings. The re module in Python allows you to work with regular expressions to search, split, and manipulate text based on specific patterns. Regular expressions are highly flexible and efficient for handling complex string operations.
Why use re in Exercise 2?
In this exercise, we need to handle several complex text manipulations:
Replace multiple spaces with a single space: Sentences in the text may have irregular spaces between words, so we need to normalize these spaces. Instead of writing loops or conditions to handle each case, we use re.sub() with a pattern r’\s+’ to easily match all occurrences of one or more spaces and replace them with a single space.
Split sentences while preserving punctuation: We need to split the text into individual sentences, where each sentence is followed by punctuation (e.g., ‘.’, ‘!’, or ‘?’). The function re.split(r’([.!?])’, text) allows us to split the text based on punctuation while keeping the punctuation marks, which is crucial for proper sentence reconstruction.
Regular expressions allow us to:
Efficiently match patterns like spaces or punctuation.
Perform complex text transformations with minimal code.
Handle edge cases that would otherwise require more manual handling.
# Assume that the argument text is a string that denotes a text, # defined as one or more sentences, two successive # sentences being separated by at least one space, # the first sentence being possibly preceded with spaces, # the last sentence being possibly followed by spaces, # a sentence being defined as at least two words, # two successive words in a sentence being separated by # at least one space, a word being defined as a sequence # of (uppercase or lowercase) letters, # - possibly followed by a comma for a word that is # not the last one in its sentence, # - definitely followed by a full stop, an exclamation mark # or a question mark for a word that is the last one # in its sentence. import re
deff2(text): # Use regular expression to replace multiple spaces with a single space text = re.sub(r'\s+', ' ', text.strip())
# Correct way to split sentences while preserving delimiters sentences = re.split(r'([.!?])', text)
# Process sentences and punctuation separately new_text = [] i = 0 while i < len(sentences) - 1: sentence = sentences[i].strip() if sentence: words = sentence.split() # Capitalize the first word and lower the rest words[0] = words[0].capitalize() for j inrange(1, len(words)): words[j] = words[j].lower() # Rebuild the sentence and add back the punctuation new_text.append(' '.join(words) + sentences[i + 1]) i += 2
return' '.join(new_text)
Exercise 3:
This exercise works with lists of integers and aims to repeatedly remove the first and last elements of the list as long as they are equal. The list is treated as a double-ended queue (deque) for efficient removal of elements from both ends.
Key Points:
The deque data structure is used because it provides O(1) operations for popping elements from both ends, which is more efficient than using lists.
The program checks if the first and last elements of the deque are equal and removes them until this condition is no longer met.
The deque is converted back to a list before being returned.
Why is deque more efficient than list in Exercise 3?
In Exercise 3, we are frequently removing elements from both the front (left) and the back (right) of the list. This is where using a deque (double-ended queue) from Python’s collections module becomes more efficient compared to using a standard list.
Here’s why:
List Behavior: When you use a standard list and call list.pop(0) to remove the first (leftmost) element, it requires shifting all the remaining elements one position to the left. This shift operation takes linear time—O(n), where n is the number of elements in the list. This means that for every removal from the front, the larger the list, the slower the operation becomes.
Removing from the right side of a list using list.pop() is an O(1) operation (constant time) because no elements need to be shifted, making it efficient only when working from the end of the list.
Deque Behavior: A deque (double-ended queue) is specifically designed to support efficient append and pop operations from both ends. In a deque, both popleft() and pop() operations take constant time—O(1)—because the deque is implemented as a doubly linked list. This means no elements need to be shifted when popping from the left or right.
In Exercise 3, where we need to frequently remove elements from both ends of the list, using a deque ensures that both the removal from the left (popleft()) and the right (pop()) are performed in constant time. This makes the entire process much more efficient, especially for large lists where repeated operations would slow down if we used a standard list.
What is a deque?
A deque (short for “double-ended queue”) is a data structure that allows for fast appending and popping of elements from both ends. It is part of the collections module in Python and is optimized for scenarios where you need to efficiently add or remove elements from both ends of the sequence.
Key Features of deque:
O(1) time complexity for operations on both ends (append, pop, appendleft, popleft).
It is implemented as a doubly linked list, meaning each element contains a reference to both the previous and next elements, allowing efficient traversal in both directions.
deque is ideal for scenarios where you need frequent and efficient insertions and removals from both the front and back of a sequence, unlike a standard list where such operations are costly at the front.
# Assume that the argument L is a list of integers. # # For as long as the list has at least two elements # and the first and last elements of the list are equal, # pop out those elements.
# def f3(L): # # Remove the list as long as it has at least two elements and the first and last elements are equal # while len(L) > 1 and L[0] == L[-1]: # L.pop(0) # Remove the first element # L.pop(-1) # Remove the last element # return L
from collections import deque
deff3(L): L = deque(L) # Convert the list to a deque for efficient popping from both ends # Continue removing elements while there are at least two elements and the first and last are equal whilelen(L) > 1and L[0] == L[-1]: L.popleft() # Efficiently remove the first element (O(1) operation) L.pop() # Efficiently remove the last element (O(1) operation) returnlist(L) # Convert the deque back to a list and return it
Exercise 4:
This exercise deals with lists of integers that are in increasing order. The goal is to remove any element whose value is equal to its index in the list. The program iterates over the list and removes such elements, ensuring the index is correctly adjusted after each removal.
Key Points:
The program uses a while loop and checks if the element at index i is equal to i. If true, it removes the element and does not increment i, so that the next element at the same position is checked.
The remove() function is used to delete the element, which is appropriate for this task.
Care is taken to ensure that index adjustments are handled correctly.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
# Assume that the argument L is a list of integers # that forms an increasing sequence. # # For as long as some member of the list is equal to its index # in the list, pop out the leftmost such member of the list.
deff4(L): i = 0 while i < len(L): if L[i] == i: L.remove(L[i]) # Using remove() here since popleft() removes from the left only else: i += 1# Only increment i if no element was removed return L # Convert deque back to list
Exercise 5:
This exercise works with a circular list of integers. The task is to identify elements that are both larger than one of their adjacent elements and smaller than the other. The result is returned as a dictionary where each key is such an element, and its value is a pair of the adjacent elements (one smaller and one larger).
Key Points:
The list is treated as circular, meaning the first element is considered adjacent to the last element.
The program iterates through the list, compares each element with its neighbors, and stores those that meet the criteria.
For each valid element, the adjacent smaller and larger elements are stored in a dictionary.
To solve this problem, we need to create a dictionary D where each key is an element in the list L that satisfies a certain condition, and the value is a tuple of two elements. The first element of this tuple is the adjacent element that is smaller than the current key, and the second element is the adjacent element that is larger than the current key.
Steps:
Loop structure: Check each element.
Processing of adjacent elements: Since the list is cyclic, the previous element of the first element is the last element, and the next element of the last element is the first element.
Condition check: Find the adjacent elements that are smaller and larger than the current element, and add them to the result dictionary.
# Assume that the argument L is a list of at least 3 distinct integers. # # Returns a dictionary D whose keys are those of the members e of L, # if any, that are # - smaller than the element right before or right after, and # - larger than the element right before or right after. # It is considered that # - the first member of L is right after the last member of L, and # - the last member of L is right before the first member of L # (as if making a ring out of the list). # For a key e in D, the associated value is the pair whose # first element is the member of L that is right before or right after # e and smaller than e, and whose second element is the member of L # that is right before or right after e and greater than e.
deff5(L): D = {} for i inrange(len(L)): m = L[i - 1] n = L[(i + 1) % len(L)] if n < m: m, n = n, m if m < L[i] < n: D[L[i]] = m, n return D
Exercise 6:
This exercise deals with factorizing an integer n into the form 2^k * m, where m is an odd number. If n is negative, the program adds a negative sign to the output. If n is zero, it prints a special message.
Key Points:
The program uses a loop to divide n by 2 until n is no longer divisible by 2, counting the number of divisions (k).
The absolute value of n is used to ensure correct handling of negative numbers, and a sign is added to the final result if the original number was negative.
The program handles the special case where n = 0 by printing a unique message.
More Details:
You need to express the given integer n as n = 2^k * m.
k represents the number of times n can be divided by 2. In other words, it is the power of 2 in the factorization of n.
m is the remaining odd part after dividing out all factors of 2.
If n is negative, the output should include a negative sign.
Special case: If n = 0, a specific message should be printed.
# Assume that the argument n is an integer. # # The output is printed out, not returned. # # You might find the abs() function useful. deff6(n): if n == 0: print("0 = 2^k * 0 for all integers k!") else: k = 0 ori = n if n < 0: sign = '-' n = -n else: sign = '' while n % 2 == 0: n //= 2 k += 1 print(f"{ori} = {sign}2^{k} * {n}") return
]]>
+ Exercise 1:
This exercise focuses on input validation and formatting floating-point numbers. The goal is to prompt the user to enter a floating-point number between -1 and 1 (exclusive). If the input is valid, the program rounds the number to two decimal places and prints it. Otherwise, it keeps prompting the user until a valid input is provided. Key Points:
The program uses a try-except block to catch invalid inputs (e.g., strings that cannot be converted to floats).
The input() function is wrapped in an infinite while loop to continuously ask for input until the correct condition is met.
In the updated version of Exercise 1, we use the formatting :.2f instead of round(). Here’s the key difference between the two:
round(): This is a Python built-in function that rounds a number to a specified number of decimal places. For example, round(1.236, 2) will return 1.24. However, the output of round() is still a float, but it does not guarantee a fixed number of decimal places when printed. For instance, round(1.0001, 2) would return 1.0 and only display one decimal place, not two.
:.2f: This is part of Python’s string formatting and ensures the number is displayed with exactly two decimal places, no matter what the number is. It also rounds the number appropriately. For instance, number = 1.0 formatted as f”{number:.2f}” will print 1.00. This makes :.2f particularly useful for consistent display of decimal places, which is important for formatting output for users.
1 2 3 4 5 6 7 8 9 10 11 12
whileTrue: try: i = input('Enter a floating point number between -1 and 1 excluded: ') number = float(i) if -1 < number < 1: # not using round() here because it rounds to the nearest even number print(f'\nUp to +/-0.005, you input {number:.2f}') else: raise ValueError break except ValueError: print("You got that wrong, try again!\n")
Exercise 2:
This exercise involves processing a block of text and formatting it into sentences. Each sentence should have its first word capitalized, and the remaining words should be in lowercase. The task is to handle spaces and punctuation properly.
Key Points:
A regular expression (re.sub) is used to replace multiple spaces with a single space.
Another regular expression (re.split) is used to split the text into sentences while preserving punctuation marks.
After splitting, the sentences are processed: the first word is capitalized, and all other words are made lowercase.
Finally, the processed sentences are recombined into a single formatted text.
Why use re in Exercise 2, and what is re?
In Exercise 2, we use re (Python’s regular expression module) to process and format the text input. Let’s break down why re is used and what it is:
What is re?
re stands for regular expressions, which are powerful tools for matching patterns in strings. The re module in Python allows you to work with regular expressions to search, split, and manipulate text based on specific patterns. Regular expressions are highly flexible and efficient for handling complex string operations.
Why use re in Exercise 2?
In this exercise, we need to handle several complex text manipulations:
Replace multiple spaces with a single space: Sentences in the text may have irregular spaces between words, so we need to normalize these spaces. Instead of writing loops or conditions to handle each case, we use re.sub() with a pattern r’\s+’ to easily match all occurrences of one or more spaces and replace them with a single space.
Split sentences while preserving punctuation: We need to split the text into individual sentences, where each sentence is followed by punctuation (e.g., ‘.’, ‘!’, or ‘?’). The function re.split(r’([.!?])’, text) allows us to split the text based on punctuation while keeping the punctuation marks, which is crucial for proper sentence reconstruction.
Regular expressions allow us to:
Efficiently match patterns like spaces or punctuation.
Perform complex text transformations with minimal code.
Handle edge cases that would otherwise require more manual handling.
# Assume that the argument text is a string that denotes a text, # defined as one or more sentences, two successive # sentences being separated by at least one space, # the first sentence being possibly preceded with spaces, # the last sentence being possibly followed by spaces, # a sentence being defined as at least two words, # two successive words in a sentence being separated by # at least one space, a word being defined as a sequence # of (uppercase or lowercase) letters, # - possibly followed by a comma for a word that is # not the last one in its sentence, # - definitely followed by a full stop, an exclamation mark # or a question mark for a word that is the last one # in its sentence. import re
deff2(text): # Use regular expression to replace multiple spaces with a single space text = re.sub(r'\s+', ' ', text.strip())
# Correct way to split sentences while preserving delimiters sentences = re.split(r'([.!?])', text)
# Process sentences and punctuation separately new_text = [] i = 0 while i < len(sentences) - 1: sentence = sentences[i].strip() if sentence: words = sentence.split() # Capitalize the first word and lower the rest words[0] = words[0].capitalize() for j inrange(1, len(words)): words[j] = words[j].lower() # Rebuild the sentence and add back the punctuation new_text.append(' '.join(words) + sentences[i + 1]) i += 2
return' '.join(new_text)
Exercise 3:
This exercise works with lists of integers and aims to repeatedly remove the first and last elements of the list as long as they are equal. The list is treated as a double-ended queue (deque) for efficient removal of elements from both ends.
Key Points:
The deque data structure is used because it provides O(1) operations for popping elements from both ends, which is more efficient than using lists.
The program checks if the first and last elements of the deque are equal and removes them until this condition is no longer met.
The deque is converted back to a list before being returned.
Why is deque more efficient than list in Exercise 3?
In Exercise 3, we are frequently removing elements from both the front (left) and the back (right) of the list. This is where using a deque (double-ended queue) from Python’s collections module becomes more efficient compared to using a standard list.
Here’s why:
List Behavior: When you use a standard list and call list.pop(0) to remove the first (leftmost) element, it requires shifting all the remaining elements one position to the left. This shift operation takes linear time—O(n), where n is the number of elements in the list. This means that for every removal from the front, the larger the list, the slower the operation becomes.
Removing from the right side of a list using list.pop() is an O(1) operation (constant time) because no elements need to be shifted, making it efficient only when working from the end of the list.
Deque Behavior: A deque (double-ended queue) is specifically designed to support efficient append and pop operations from both ends. In a deque, both popleft() and pop() operations take constant time—O(1)—because the deque is implemented as a doubly linked list. This means no elements need to be shifted when popping from the left or right.
In Exercise 3, where we need to frequently remove elements from both ends of the list, using a deque ensures that both the removal from the left (popleft()) and the right (pop()) are performed in constant time. This makes the entire process much more efficient, especially for large lists where repeated operations would slow down if we used a standard list.
What is a deque?
A deque (short for “double-ended queue”) is a data structure that allows for fast appending and popping of elements from both ends. It is part of the collections module in Python and is optimized for scenarios where you need to efficiently add or remove elements from both ends of the sequence.
Key Features of deque:
O(1) time complexity for operations on both ends (append, pop, appendleft, popleft).
It is implemented as a doubly linked list, meaning each element contains a reference to both the previous and next elements, allowing efficient traversal in both directions.
deque is ideal for scenarios where you need frequent and efficient insertions and removals from both the front and back of a sequence, unlike a standard list where such operations are costly at the front.
# Assume that the argument L is a list of integers. # # For as long as the list has at least two elements # and the first and last elements of the list are equal, # pop out those elements.
# def f3(L): # # Remove the list as long as it has at least two elements and the first and last elements are equal # while len(L) > 1 and L[0] == L[-1]: # L.pop(0) # Remove the first element # L.pop(-1) # Remove the last element # return L
from collections import deque
deff3(L): L = deque(L) # Convert the list to a deque for efficient popping from both ends # Continue removing elements while there are at least two elements and the first and last are equal whilelen(L) > 1and L[0] == L[-1]: L.popleft() # Efficiently remove the first element (O(1) operation) L.pop() # Efficiently remove the last element (O(1) operation) returnlist(L) # Convert the deque back to a list and return it
Exercise 4:
This exercise deals with lists of integers that are in increasing order. The goal is to remove any element whose value is equal to its index in the list. The program iterates over the list and removes such elements, ensuring the index is correctly adjusted after each removal.
Key Points:
The program uses a while loop and checks if the element at index i is equal to i. If true, it removes the element and does not increment i, so that the next element at the same position is checked.
The remove() function is used to delete the element, which is appropriate for this task.
Care is taken to ensure that index adjustments are handled correctly.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
# Assume that the argument L is a list of integers # that forms an increasing sequence. # # For as long as some member of the list is equal to its index # in the list, pop out the leftmost such member of the list.
deff4(L): i = 0 while i < len(L): if L[i] == i: L.remove(L[i]) # Using remove() here since popleft() removes from the left only else: i += 1# Only increment i if no element was removed return L # Convert deque back to list
Exercise 5:
This exercise works with a circular list of integers. The task is to identify elements that are both larger than one of their adjacent elements and smaller than the other. The result is returned as a dictionary where each key is such an element, and its value is a pair of the adjacent elements (one smaller and one larger).
Key Points:
The list is treated as circular, meaning the first element is considered adjacent to the last element.
The program iterates through the list, compares each element with its neighbors, and stores those that meet the criteria.
For each valid element, the adjacent smaller and larger elements are stored in a dictionary.
To solve this problem, we need to create a dictionary D where each key is an element in the list L that satisfies a certain condition, and the value is a tuple of two elements. The first element of this tuple is the adjacent element that is smaller than the current key, and the second element is the adjacent element that is larger than the current key.
Steps:
Loop structure: Check each element.
Processing of adjacent elements: Since the list is cyclic, the previous element of the first element is the last element, and the next element of the last element is the first element.
Condition check: Find the adjacent elements that are smaller and larger than the current element, and add them to the result dictionary.
# Assume that the argument L is a list of at least 3 distinct integers. # # Returns a dictionary D whose keys are those of the members e of L, # if any, that are # - smaller than the element right before or right after, and # - larger than the element right before or right after. # It is considered that # - the first member of L is right after the last member of L, and # - the last member of L is right before the first member of L # (as if making a ring out of the list). # For a key e in D, the associated value is the pair whose # first element is the member of L that is right before or right after # e and smaller than e, and whose second element is the member of L # that is right before or right after e and greater than e.
deff5(L): D = {} for i inrange(len(L)): m = L[i - 1] n = L[(i + 1) % len(L)] if n < m: m, n = n, m if m < L[i] < n: D[L[i]] = m, n return D
Exercise 6:
This exercise deals with factorizing an integer n into the form 2^k * m, where m is an odd number. If n is negative, the program adds a negative sign to the output. If n is zero, it prints a special message.
Key Points:
The program uses a loop to divide n by 2 until n is no longer divisible by 2, counting the number of divisions (k).
The absolute value of n is used to ensure correct handling of negative numbers, and a sign is added to the final result if the original number was negative.
The program handles the special case where n = 0 by printing a unique message.
More Details:
You need to express the given integer n as n = 2^k * m.
k represents the number of times n can be divided by 2. In other words, it is the power of 2 in the factorization of n.
m is the remaining odd part after dividing out all factors of 2.
If n is negative, the output should include a negative sign.
Special case: If n = 0, a specific message should be printed.
# Assume that the argument n is an integer. # # The output is printed out, not returned. # # You might find the abs() function useful. deff6(n): if n == 0: print("0 = 2^k * 0 for all integers k!") else: k = 0 ori = n if n < 0: sign = '-' n = -n else: sign = '' while n % 2 == 0: n //= 2 k += 1 print(f"{ori} = {sign}2^{k} * {n}") return
FOR VERY VERY VERY VERY VERY BIG NUMBER:
When dealing with very large integers, the method of continuously dividing the number by 2 to factor out powers of 2 (2^k) can become inefficient. This is because each division can be costly in terms of computational time, especially for very large numbers with millions or billions of digits. Each division involves recalculating the entire integer, which is slow for large integers. Using Bit Manipulation:
A much more efficient approach is to use bit manipulation to determine how many times a number can be divided by 2 (i.e., how many factors of 2 it has). This method avoids division altogether and instead directly analyzes the binary representation of the number to count the number of trailing zeros, which correspond to the powers of 2 in the factorization.
Why?
Bitwise operations are much faster than arithmetic operations like division, especially for large integers. Counting the trailing zeros in a number’s binary representation can be done in constant time.
Extracting the lowest set bit of a number allows us to quickly find how many times a number can be divided by 2 without having to repeatedly divide the number. This provides the power of 2 (k) directly.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
deff6(n): if n == 0: print("0 = 2^k * 0 for all integers k!") return # Handle negative sign sign = '-'if n < 0else'' n = abs(n) # Using bit manipulation to count how many trailing zeros (powers of 2) k = (n & -n).bit_length() - 1# Count trailing zeros by isolating the lowest set bit # Remove 2^k factor from n m = n >> k # Equivalent to n // 2^k, shifting right by k bits # Print the result print(f"{sign}{n} = {sign}2^{k} * {m}")
Welcome to my personal blog repository on Github! My name is Sizhuo Long, and I am currently a student in Australia. This repository is home to my personal blog, which is built using the HEXO static site generator.
On my blog, you’ll find a variety of content including my thoughts on technology, programming, and the latest developments in my field of study. I also share my experiences and lessons learned from the projects I’ve worked on.
I hope that by sharing my knowledge and insights, I can help others who are interested in the same topics. I welcome any comments and feedback, and I am always open to collaboration.
Thank you for visiting my blog, I hope you will find something interesting here. And I would really appreciate it if you could pay more attention to my blog and follow me.
Why you should follow me
I’ll share my personal experiences and thoughts on technology and programming
I’ll keep you updated on the latest developments in my field of study
Thank you for reading, and I hope you enjoy my blog!
Single -cellRNAData analysis tool The project I did before,There are many errors,Don’t spray。 Shu Di Travel Bacteria This is a small assignment when I was a second junior year,It’s a group operation。At first I couldn’t get the linkhtmldocument,I read a lot of official documents orCSDNdocument 。Finally read an article,Said to beHEXODang thegeneratewhen,I willsource中的documentappendarrivepublicMiddle,I tried many times later,Discover directly public为源document夹,Just call the directory。Although this will cause it to be unable to bemddocument中超链接arrivedocument。
at the same time,也exist新的bugunsolved:login.htmlUnable toindex.htmlJump Linkin:
Welcome to my personal blog repository on Github! My name is Sizhuo Long, and I am currently a student in Australia. This repository is home to my personal blog, which is built using the HEXO static site generator.
On my blog, you’ll find a variety of content including my thoughts on technology, programming, and the latest developments in my field of study. I also share my experiences and lessons learned from the projects I’ve worked on.
I hope that by sharing my knowledge and insights, I can help others who are interested in the same topics. I welcome any comments and feedback, and I am always open to collaboration.
Thank you for visiting my blog, I hope you will find something interesting here. And I would really appreciate it if you could pay more attention to my blog and follow me.
Why you should follow me
I’ll share my personal experiences and thoughts on technology and programming
I’ll keep you updated on the latest developments in my field of study
Thank you for reading, and I hope you enjoy my blog!
Single -cellRNAData analysis tool The project I did before,There are many errors,Don’t spray。 Shu Di Travel Bacteria This is a small assignment when I was a second junior year,It’s a group operation。At first I couldn’t get the linkhtmldocument,I read a lot of official documents orCSDNdocument 。Finally read an article,Said to beHEXODang thegeneratewhen,I willsource中的documentappendarrivepublicMiddle,I tried many times later,Discover directly public为源document夹,Just call the directory。Although this will cause it to be unable to bemddocument中超链接arrivedocument。
at the same time,也exist新的bugunsolved:login.htmlUnable toindex.htmlJump Linkin:
This question is not,I thought it was a double pointer but timeout over time,结果是Prefix and算法。The following isSpiritual godSolution 通过Prefix and,我们可以把Elements and elements of sub -array转换成两个Prefix and的差,Right now $$ \sum_{j=left}^{right} nums[j] = \sum_{j=0}^{right} nums[j]− \sum_{j=0}^{left-1} nums[j]=s[right+1]−s[left] $$ Now that I said it「Elements and elements of sub -array」,那么利用Prefix and s,Turn the problem to: Find two bidding i and j,satisfy j<ij<ij<i and s[j]<s[i],maximize i−jValue。
Code:
Double pointer
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
classSolution: deflongestWPI(self, hours: List[int]) -> int: ans = 0 for index, i inenumerate(hours): count = 0 j = index while j < len(hours): if hours[j] <= 8: count -= 1 elif hours[j] > 8: count += 1 if count > 0: ans = max(ans, j - index + 1) j += 1 return ans
Prefix and
1 2 3 4 5 6 7 8 9 10 11 12 13 14
classSolution: deflongestWPI(self, hours: List[int]) -> int: n = len(hours) s = [0] * (n + 1) st = [0] for j, h inenumerate(hours, 1): s[j] = s[j - 1] + (1if h > 8else -1) if s[j] < s[st[-1]]: st.append(j) ans = 0 for i inrange(n, 0 , -1): while st and s[i] > s[st[-1]]: ans = max(ans, i-st.pop()) return ans
]]>
+ topic:
Give you an integer n ,Return to the integer in the form of a binary string Negative binary(base -2)express。
Notice,Unless the string is "0",Otherwise, the returned string cannot contain the front guide zero。
We can judge n Every bit from low to high,If the bit is 1,Then the answer is 1,Otherwise 0。If the bit is 1,So we need to n minus k。Next we update n=⌊n/2⌋, k=−k。Continue to judge the next。 at last,We will return to the answer。 time complexity O(logn),in n For the given integer。Ignore the space consumption of the answer,Spatial complexity O(1)。
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
classSolution: defbaseNeg2(self, n: int) -> str: k = 1 ans = [] while n: if n % 2: ans.append('1') n -= k else: ans.append('0') n //= 2 k *= -1 return''.join(ans[::-1]) or'0'
]]>
- <h1 id="topic:"><a href="#topic:" class="headerlink" title="topic:"></a>topic:</h1><p><img src="../assets/img/2023-02-15.png" alt="2023-02-1
+ <h1 id="topic:"><a href="#topic:" class="headerlink" title="topic:"></a>topic:</h1><p>Give you an integer <code>n</code> ,Return to the inte
@@ -220,23 +220,21 @@
-
-
- 1017.Negative binary conversion
-
- https://longsizhuo.github.io/post/80cafdc8.html
+ 1124. The longest period of performance One question daily
+
+ https://longsizhuo.github.io/post/a5d1dfda.html2023-12-31T13:00:00.000Z2024-09-10T15:11:32.922Z
- topic:
Give you an integer n ,Return to the integer in the form of a binary string Negative binary(base -2)express。
Notice,Unless the string is "0",Otherwise, the returned string cannot contain the front guide zero。
We can judge n Every bit from low to high,If the bit is 1,Then the answer is 1,Otherwise 0。If the bit is 1,So we need to n minus k。Next we update n=⌊n/2⌋, k=−k。Continue to judge the next。 at last,We will return to the answer。 time complexity O(logn),in n For the given integer。Ignore the space consumption of the answer,Spatial complexity O(1)。
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
classSolution: defbaseNeg2(self, n: int) -> str: k = 1 ans = [] while n: if n % 2: ans.append('1') n -= k else: ans.append('0') n //= 2 k *= -1 return''.join(ans[::-1]) or'0'
This question is not,I thought it was a double pointer but timeout over time,结果是Prefix and算法。The following isSpiritual godSolution 通过Prefix and,我们可以把Elements and elements of sub -array转换成两个Prefix and的差,Right now $$ \sum_{j=left}^{right} nums[j] = \sum_{j=0}^{right} nums[j]− \sum_{j=0}^{left-1} nums[j]=s[right+1]−s[left] $$ Now that I said it「Elements and elements of sub -array」,那么利用Prefix and s,Turn the problem to: Find two bidding i and j,satisfy j<ij<ij<i and s[j]<s[i],maximize i−jValue。
Code:
Double pointer
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
classSolution: deflongestWPI(self, hours: List[int]) -> int: ans = 0 for index, i inenumerate(hours): count = 0 j = index while j < len(hours): if hours[j] <= 8: count -= 1 elif hours[j] > 8: count += 1 if count > 0: ans = max(ans, j - index + 1) j += 1 return ans
Prefix and
1 2 3 4 5 6 7 8 9 10 11 12 13 14
classSolution: deflongestWPI(self, hours: List[int]) -> int: n = len(hours) s = [0] * (n + 1) st = [0] for j, h inenumerate(hours, 1): s[j] = s[j - 1] + (1if h > 8else -1) if s[j] < s[st[-1]]: st.append(j) ans = 0 for i inrange(n, 0 , -1): while st and s[i] > s[st[-1]]: ans = max(ans, i-st.pop()) return ans
]]>
- <h1 id="topic:"><a href="#topic:" class="headerlink" title="topic:"></a>topic:</h1><p>Give you an integer <code>n</code> ,Return to the inte
+ <h1 id="topic:"><a href="#topic:" class="headerlink" title="topic:"></a>topic:</h1><p><img src="../assets/img/2023-02-15.png" alt="2023-02-1
@@ -246,6 +244,8 @@
+
+
@@ -273,18 +273,18 @@
- 1233Delete the subfolder folder One question daily
-
- https://longsizhuo.github.io/post/6610c769.html
+ 1139. The greatest 1 Formation of the border One question daily
+
+ https://longsizhuo.github.io/post/eb193c1f.html2023-12-31T13:00:00.000Z2024-09-10T15:11:32.922Z
- topic:
脑子里的构思yesDictionary tree,ButClanguage的Dictionary tree,Whether it isPython still golangI won’t write。 So helpless can only look at the answer。 ylbThe big guy is right firstlistSort,Then traverse the list。
1.ifiBefore[len(ans[-1])]Just happensans[-1]The element is consistent,Explainiyes ans[-1]Subfolder folder,Then skip。
2.ifyes["/a/b/c","/a/b/ca","/a/b/d"]This situation,Be alone1.的判断yes不够的,at this time "/a/b/ca"Before缀and"/a/b/c"yes一样的,但yescaandc实际上yes两个不同的文件夹,So add a judgment front end yes否yes/,"/a/b/ca"and"/a/b/c/a"中后者才会被判定yes前面一个元素的子集。
Dictionary tree没太看懂: 我们可以使用Dictionary tree存储数组 folder All folders in。 Dictionary tree的每个节点包含 children Field,Sub -nodes for storing the current nodes,as well as fid Field, Used to store the folder corresponding to the current node in the array folder Bidding。
For array folder Each folder in it f,We will first f according to / Divide into several skewers, Then start from the root node,依次将子串加入Dictionary tree中。Next,我们从根节点开始搜索Dictionary tree, if当前节点的 fid Field不为 -1,则说明当前节点对应的文件夹yes答案数组中的一个文件夹, We add it to the array and return。otherwise,We search for all sub -nodes of the current node,Finally return to the array of answers。
classSolution: defremoveSubfolders(self, folder: List[str]) -> List[str]: folder.sort() ans = [folder[0]] for i in folder[1:]: m, n = len(ans[-1]), len(i) # if它的长度大于等于答案数组中最后一个文件夹的长度,并且它Before缀包含答案数组的最后一个文件夹再加上一个 / if m >= n ornot (ans[-1] == i[:m] and i[m] == '/'): ans.append(i) return ans # Dictionary tree classTrie: def__init__(self): self.children = {} self.fid = -1
definsert(self, i, f): node = self ps = f.split('/') for p in ps[1:]: if p notin node.children: node.children[p] = Trie() node = node.children[p] node.fid = 1
defsearch(self): defdfs(root): if root.fid != -1: ans.append(root.fid) return for child in root.children.values(): dfs(child) ans = [] dfs(self) return ans classSolution: defremoveSubfolders(self, folder: List[str]) -> List[str]: trie = Trie() for i, f inenumerate(folder): trie.insert(i, f) return [folder[i] for i in trie.search()]
golang
1 2 3 4 5 6 7 8 9 10 11
funcremoveSubfolders(folder []string) (ans []string) { sort.Strings(folder) ans = []string{folder[0]} for _, i := range folder[1:] { m, n := len(ans[len(ans)-1]), len(i) if m >= n || !(ans[len(ans)-1] == i[:m] && i[m] == '/'){ ans = append(ans, i) } } return }
quiz6 Simple version,Prefix and求解。It should be noted that the upper left corner is0 Special circumstances are not considered, Need to verify # superior Left Down right Four -edge 1 The number of individuals d
classSolution: deflargest1BorderedSquare(self, grid: List[List[int]]) -> int: matrix_heng = copy.deepcopy(grid) matrix_su = copy.deepcopy(grid) ans = 0 iflen(grid) == 1: if1in grid[0]: return1 else:return0 for ind, i inenumerate(grid): for index inrange(len(i)): # Each line adds if index >= 1: matrix_heng[ind][index] += matrix_heng[ind][index-1] # Add each column if ind >= 1: matrix_su[ind][index] += matrix_su[ind-1][index] print(matrix_heng, matrix_su) for i inrange(len(grid)): for j inrange(len(grid[i])): minus = min(matrix_heng[i][j], matrix_su[i][j]) try: if grid[i-minus+1][j-minus+1] == 1and i >= minus-1and j >= minus-1: ans = max(ans, minus ** 2) except: pass return ans
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
classSolution: deflargest1BorderedSquare(self, grid: List[List[int]]) -> int: m, n = len(grid), len(grid[0]) rs = [list(accumulate(row, initial=0)) for row in grid] # 每行的Prefix and cs = [list(accumulate(col, initial=0)) for col inzip(*grid)] # 每列的Prefix and for d inrange(min(m, n), 0, -1): # From large to small enumeration square edges d for i inrange(m - d + 1): for j inrange(n - d + 1): # 枚举正方形Leftsuperior角坐标 (i,j) # superior Left Down right Four -edge 1 The number of individuals d if rs[i][j + d] - rs[i][j] == d and \ cs[j][i + d] - cs[j][i] == d and \ rs[i + d - 1][j + d] - rs[i + d - 1][j] == d and \ cs[j + d - 1][i + d] - cs[j + d - 1][i] == d: return d * d return0
]]>
- <h1 id="topic:"><a href="#topic:" class="headerlink" title="topic:"></a>topic:</h1><p><img src="../assets/img/2023-02-09.png" alt="2023-02-0
+ <h1 id="topic:"><a href="#topic:" class="headerlink" title="topic:"></a>topic:</h1><p><img src="../assets/img/2023-02-17.png" alt="2023-02-1
@@ -294,23 +294,23 @@
-
+
- 1139. The greatest 1 Formation of the border One question daily
-
- https://longsizhuo.github.io/post/eb193c1f.html
+ 1233Delete the subfolder folder One question daily
+
+ https://longsizhuo.github.io/post/6610c769.html2023-12-31T13:00:00.000Z2024-09-10T15:11:32.922Z
- topic:
quiz6 Simple version,Prefix and求解。It should be noted that the upper left corner is0 Special circumstances are not considered, Need to verify # superior Left Down right Four -edge 1 The number of individuals d
classSolution: deflargest1BorderedSquare(self, grid: List[List[int]]) -> int: matrix_heng = copy.deepcopy(grid) matrix_su = copy.deepcopy(grid) ans = 0 iflen(grid) == 1: if1in grid[0]: return1 else:return0 for ind, i inenumerate(grid): for index inrange(len(i)): # Each line adds if index >= 1: matrix_heng[ind][index] += matrix_heng[ind][index-1] # Add each column if ind >= 1: matrix_su[ind][index] += matrix_su[ind-1][index] print(matrix_heng, matrix_su) for i inrange(len(grid)): for j inrange(len(grid[i])): minus = min(matrix_heng[i][j], matrix_su[i][j]) try: if grid[i-minus+1][j-minus+1] == 1and i >= minus-1and j >= minus-1: ans = max(ans, minus ** 2) except: pass return ans
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
classSolution: deflargest1BorderedSquare(self, grid: List[List[int]]) -> int: m, n = len(grid), len(grid[0]) rs = [list(accumulate(row, initial=0)) for row in grid] # 每行的Prefix and cs = [list(accumulate(col, initial=0)) for col inzip(*grid)] # 每列的Prefix and for d inrange(min(m, n), 0, -1): # From large to small enumeration square edges d for i inrange(m - d + 1): for j inrange(n - d + 1): # 枚举正方形Leftsuperior角坐标 (i,j) # superior Left Down right Four -edge 1 The number of individuals d if rs[i][j + d] - rs[i][j] == d and \ cs[j][i + d] - cs[j][i] == d and \ rs[i + d - 1][j + d] - rs[i + d - 1][j] == d and \ cs[j + d - 1][i + d] - cs[j + d - 1][i] == d: return d * d return0
脑子里的构思yesDictionary tree,ButClanguage的Dictionary tree,Whether it isPython still golangI won’t write。 So helpless can only look at the answer。 ylbThe big guy is right firstlistSort,Then traverse the list。
1.ifiBefore[len(ans[-1])]Just happensans[-1]The element is consistent,Explainiyes ans[-1]Subfolder folder,Then skip。
2.ifyes["/a/b/c","/a/b/ca","/a/b/d"]This situation,Be alone1.的判断yes不够的,at this time "/a/b/ca"Before缀and"/a/b/c"yes一样的,但yescaandc实际上yes两个不同的文件夹,So add a judgment front end yes否yes/,"/a/b/ca"and"/a/b/c/a"中后者才会被判定yes前面一个元素的子集。
Dictionary tree没太看懂: 我们可以使用Dictionary tree存储数组 folder All folders in。 Dictionary tree的每个节点包含 children Field,Sub -nodes for storing the current nodes,as well as fid Field, Used to store the folder corresponding to the current node in the array folder Bidding。
For array folder Each folder in it f,We will first f according to / Divide into several skewers, Then start from the root node,依次将子串加入Dictionary tree中。Next,我们从根节点开始搜索Dictionary tree, if当前节点的 fid Field不为 -1,则说明当前节点对应的文件夹yes答案数组中的一个文件夹, We add it to the array and return。otherwise,We search for all sub -nodes of the current node,Finally return to the array of answers。
classSolution: defremoveSubfolders(self, folder: List[str]) -> List[str]: folder.sort() ans = [folder[0]] for i in folder[1:]: m, n = len(ans[-1]), len(i) # if它的长度大于等于答案数组中最后一个文件夹的长度,并且它Before缀包含答案数组的最后一个文件夹再加上一个 / if m >= n ornot (ans[-1] == i[:m] and i[m] == '/'): ans.append(i) return ans # Dictionary tree classTrie: def__init__(self): self.children = {} self.fid = -1
definsert(self, i, f): node = self ps = f.split('/') for p in ps[1:]: if p notin node.children: node.children[p] = Trie() node = node.children[p] node.fid = 1
defsearch(self): defdfs(root): if root.fid != -1: ans.append(root.fid) return for child in root.children.values(): dfs(child) ans = [] dfs(self) return ans classSolution: defremoveSubfolders(self, folder: List[str]) -> List[str]: trie = Trie() for i, f inenumerate(folder): trie.insert(i, f) return [folder[i] for i in trie.search()]
golang
1 2 3 4 5 6 7 8 9 10 11
funcremoveSubfolders(folder []string) (ans []string) { sort.Strings(folder) ans = []string{folder[0]} for _, i := range folder[1:] { m, n := len(ans[len(ans)-1]), len(i) if m >= n || !(ans[len(ans)-1] == i[:m] && i[m] == '/'){ ans = append(ans, i) } } return }
]]>
- <h1 id="topic:"><a href="#topic:" class="headerlink" title="topic:"></a>topic:</h1><p><img src="../assets/img/2023-02-17.png" alt="2023-02-1
+ <h1 id="topic:"><a href="#topic:" class="headerlink" title="topic:"></a>topic:</h1><p><img src="../assets/img/2023-02-09.png" alt="2023-02-0
@@ -320,7 +320,7 @@
-
+
@@ -399,24 +399,20 @@
- 142.Ring linkedII
-
- https://longsizhuo.github.io/post/e2c9cca9.html
+ 1551. Make all the minimum operations of all elements in the array
+
+ https://longsizhuo.github.io/post/b2a927d5.html2023-12-31T13:00:00.000Z2024-09-10T15:11:32.923Z
- 142.Ring listII.md
Thought:
Problem -solving:
这类Linkedtopic一般都yes使用双pointer法解决的,For example, looking for distance tail K Node、Find a ring entrance、Find the entrance of the public tail, etc.。
Algorithm:
Double pointer met for the first time: Set two pointers fast,slow 指向Linked头部 head,fast Walk per round 2 step,slow Walk per round 1 step;
a. First result: fast pointer走过Linked末端,说明Linked无环,直接return null;
.TIPS: If there is a ring,Two pointers will definitely meet。Because every time I go 1 wheel,fast and slow Pitch +1,fast The event will catch up slow; b. Second result: whenfast == slowhour, Two pointers in the ring First encounter 。下面分析此hourfast and slowPassing step数关系 :
.设Linked共have a+b Node,in Linked头部到Linked入口 have a Node(不计Linked入口节点), Linked环 have b Node(这里需要Notice,a and b yes未知数,例如图解上Linked a=4 , b=5);Set two pointers分别走了 f,s step,则have: a. fast 走的step数yesslowstep数的 2 Double,Right now f=2s;(Analyze: fast Walk per round 2 step) b.fast Compare slowGo more n Length of a ring,Right now f=s+nb;( Analyze: Double pointers have gone through a step,然后在环Inside绕圈直到重合,重合hour fast Compare slow Go 环的长度整数Double ); .The above two types are reduced:f=2nb,s=nb,Right nowfastandslow The pointer left separately 2n,n indivual Circumference of the ring (Notice: n yes未知数,不同Linked的情况不同)。
Current situation analysis:
.if让pointer从Linked头部一直向前走并统计step数k,那么所have 走到Linked入口节点hour的step数 yes:k=a+nb(Leave first a step到入口节点,Over time 1 Ring( b step)I will go to the entrance node again)。
..Current,slow pointerPassingstep数为 nb step。therefore,We just find a way slow Go again a step停下来,You can get to the entrance to the ring。
…但yes我们不知道 a Value,what to do?依然yes使用双pointer法。我们构建一indivualpointer,此pointer需要have以下性质:此pointerandslow Go forward together a step后,The two nodes at the entrance re -coincide。So where does it need to get to the entrance node? a step?答案yesLinked头部head。
Double pointer met for the second time: .slowpointer Unchanged position ,Willfastpointer重新 指向Linked头部节点 ;slowandfast同hour每wheel向前走 1 step;
..TIPS:此hour f=0,s=nb ; …when fast pointer走到f=a stephour,slow pointer走到steps=a+nb,此hour 两pointer重合,并同hour指向Linked环入口 。
returnslowpointer指向的节点。
Complexity analysis:
hour间复杂度 O(N) :In the second encounter,慢pointer须走step数 a<a+b;First encounter中,慢pointer须走step数 a+b−x<a+b,in x 为双pointer重合点and环入口距离;therefore总体为线性复杂度; Spatial complexity O(1) :双pointer使用常数大小的额外空间。
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
classSolution: defdetectCycle(self, head: Optional[ListNode]) -> Optional[ListNode]: a = head b = head whileTrue: ifnot b ornot b.next: returnNone a = a.next b = b.next.next if b == a: break b = head while a != b: a, b = a.next, b.next return b
classSolution { public: ListNode *detectCycle(ListNode *head){ ListNode *a = head; ListNode *b = head; while (true) { if (!b or !b->next) { returnnullptr; } a = a->next; b = b->next->next; //becauseb每次走两step,soabMust meet if (a == b) { break; } } // After meetingaWait in placeb, b去Linked头部 b = head; while(a!=b){ a = a->next; b = b->next; }
return a; } };
]]>
+
Thought:
It is the second question of the weekly match:6275Make all the minimum operations of all elements in the arrayII.md The first edition of the heart of the heart。It’s completely different from the second edition,Originally wanted to practice the greedy algorithm。但是做着做着就发现了存在math规律。 Quote[yong]Big guy’s words: Because it is the difference between the difference,很可能找到一个math公式,useO(1)Time complexity solution. Get a few simple examples first to find the rules
n=3 The minimum operation is 2
n=4 The minimum operation is 1 + 3
n=5 The minimum operation is 2 + 4
n=6 The minimum operation is 1 + 3 + 5
n=7 The minimum operation is 2 + 4 + 6 whennWhen the number is,The minimum operation is1 + 3 + 5 + ... + n-1 = n*n/4 whennWhen it is a strange number,The minimum operation is2 + 4 + ... + n-1 = (n*n - 1) / 4
Get this question,Feel a bit around,Careful analysis discovery arr[i] = (2 * i) + 1 (0 <= i < n)Is a typical equal number list(1,3,5,7,9...). According to the formula of the equal number column,It’s easy to find a grouparrThe total element isn^2. In the question design, two bids are selected for each operationx ymakearr[x]minus onearr[y]plus one. in other words,No matter how you choosex y,No matter how many times the operation,The sum of the array will not change. The design and guarantee that all elements in the array can ultimately be equal equal. Then we assume that the final element is equal toaSon*a == n^2,soa == n,That is to say, the final array elements are alln.actuallynIs the average value of the array. Know the end element is allnback,Start traversing in the middle by starting from the start and end of the array,You can reach the smallest number of operations. Suppose the bidding on the left isi ((2 * i) + 1 < n)So相应右边的下标是n - i. The corresponding two elemental values andnThe difference isn - 1 + 2 * i.so我们只要计算数组中值小于nElements andnSummary of difference,Get the minimum operation number.
Code:
java
1 2 3 4
intminOperations(int n) { return n * n / 4; } // Time and space complexity is all O(1)
java
1 2 3 4 5 6 7 8
intminOperations(int n) { intoperation=0; for(inti=1; i < n ; i += 2) { operation += (n - i); } return operation; } // Time complexity isO(n) Space complexity isO(1)
python
1 2 3 4 5 6
classSolution: defminOperations(self, n: int) -> int: operate = 0 for i inrange(1, n, 2): operate += (n - i) return operate
erlang
1 2 3
-spec min_operations(N :: integer()) -> integer(). min_operations(N) -> N * N div4.
dart
1 2 3 4 5
classSolution{ int minOperations(int n) { return n * n ~/ 4; } }
elixir
1 2 3 4 5 6
defmoduleSolutiondo @spec min_operations(n :: integer) :: integer defmin_operations(n) do div(n * n , 4) end end
]]>
- <p><img src="../assets/img/2023-07-01%20(1).png" alt="2023-07-01 (1).png"><br><a href="https://leetcode.cn/problems/linked-list-cycle-ii/">142.Ring listII.md</a></p>
-<h1 id="Thought:"><a href="#Thought:" class="headerlink" title="Thought:"></a>Thought:</h1><h3 id="Problem-solving:"><a href="#Problem-solving:" class="headerlink" title="Problem -solving:"></a>Problem -solving:</h3><p>这类Linkedtopic一般都yes使用双pointer法解决的,For example, looking for distance tail K Node、Find a ring entrance、Find the entrance of the public tail, etc.。</p>
-<h3 id="Algorithm:"><a href="#Algorithm:" class="headerlink" title="Algorithm:"></a>Algorithm:</h3><ol>
-<li><p>Double pointer met for the first time: Set two pointers fast,slow 指向Linked头部 head,fast Walk per round 2 step,slow Walk per round 1 step;</p>
-<p> a. First result: fast pointer走过Linked末端,说明Linked无环,直接return null;</p>
-<p> .TIPS: If there is a ring,Two pointers will definitely meet。Because every time I go 1 wheel,fast and slow Pitch +1,fast The event will catch up slow;<br> b. Second result: whenfast == slowhour, Two pointers in the ring First encounter 。下面分析此hourfast and slowPassing step数关系 :</p>
-<p> .设Linked共have a+b Node,in Linked头部到Linked入口 have a Node(不计Linked入口节点), Linked环 have b Node(这里需要Notice,a and b yes未知数,例如图解上Linked a=4 , b=5);Set two pointers分别走了 f,s step,则have:<br> a. fast 走的step数yesslowstep数的 2 Double,Right now f=2s;(Analyze: fast Walk per round 2 step)<br> b.fast Compare slowGo more n Length of a ring,Right now f=s+nb;( Analyze: Double pointers have gone through a step,然后在环Inside绕圈直到重合,重合hour fast Compare slow Go 环的长度整数Double );<br> .The above two types are reduced:f=2nb,s=nb,Right nowfastandslow The pointer left separately 2n,n indivual Circumference of the ring (Notice: n yes未知数,不同Linked的情况不同)。</p>
-</li>
-</ol>
+
+
+ <p><img src="../assets/img/2023-01-22%20(3).png" alt="2023-01-22 (3).png"></p>
+<h1 id="Thought:"><a href="#Thought:" class="headerlink" titl
+
@@ -425,23 +421,29 @@
+
+
- 1551. Make all the minimum operations of all elements in the array
-
- https://longsizhuo.github.io/post/b2a927d5.html
+ 142.Ring linkedII
+
+ https://longsizhuo.github.io/post/e2c9cca9.html2023-12-31T13:00:00.000Z2024-09-10T15:11:32.923Z
-
Thought:
It is the second question of the weekly match:6275Make all the minimum operations of all elements in the arrayII.md The first edition of the heart of the heart。It’s completely different from the second edition,Originally wanted to practice the greedy algorithm。但是做着做着就发现了存在math规律。 Quote[yong]Big guy’s words: Because it is the difference between the difference,很可能找到一个math公式,useO(1)Time complexity solution. Get a few simple examples first to find the rules
n=3 The minimum operation is 2
n=4 The minimum operation is 1 + 3
n=5 The minimum operation is 2 + 4
n=6 The minimum operation is 1 + 3 + 5
n=7 The minimum operation is 2 + 4 + 6 whennWhen the number is,The minimum operation is1 + 3 + 5 + ... + n-1 = n*n/4 whennWhen it is a strange number,The minimum operation is2 + 4 + ... + n-1 = (n*n - 1) / 4
Get this question,Feel a bit around,Careful analysis discovery arr[i] = (2 * i) + 1 (0 <= i < n)Is a typical equal number list(1,3,5,7,9...). According to the formula of the equal number column,It’s easy to find a grouparrThe total element isn^2. In the question design, two bids are selected for each operationx ymakearr[x]minus onearr[y]plus one. in other words,No matter how you choosex y,No matter how many times the operation,The sum of the array will not change. The design and guarantee that all elements in the array can ultimately be equal equal. Then we assume that the final element is equal toaSon*a == n^2,soa == n,That is to say, the final array elements are alln.actuallynIs the average value of the array. Know the end element is allnback,Start traversing in the middle by starting from the start and end of the array,You can reach the smallest number of operations. Suppose the bidding on the left isi ((2 * i) + 1 < n)So相应右边的下标是n - i. The corresponding two elemental values andnThe difference isn - 1 + 2 * i.so我们只要计算数组中值小于nElements andnSummary of difference,Get the minimum operation number.
Code:
java
1 2 3 4
intminOperations(int n) { return n * n / 4; } // Time and space complexity is all O(1)
java
1 2 3 4 5 6 7 8
intminOperations(int n) { intoperation=0; for(inti=1; i < n ; i += 2) { operation += (n - i); } return operation; } // Time complexity isO(n) Space complexity isO(1)
python
1 2 3 4 5 6
classSolution: defminOperations(self, n: int) -> int: operate = 0 for i inrange(1, n, 2): operate += (n - i) return operate
erlang
1 2 3
-spec min_operations(N :: integer()) -> integer(). min_operations(N) -> N * N div4.
dart
1 2 3 4 5
classSolution{ int minOperations(int n) { return n * n ~/ 4; } }
elixir
1 2 3 4 5 6
defmoduleSolutiondo @spec min_operations(n :: integer) :: integer defmin_operations(n) do div(n * n , 4) end end
这类Linkedtopic一般都yes使用双pointer法解决的,For example, looking for distance tail K Node、Find a ring entrance、Find the entrance of the public tail, etc.。
Algorithm:
Double pointer met for the first time: Set two pointers fast,slow 指向Linked头部 head,fast Walk per round 2 step,slow Walk per round 1 step;
a. First result: fast pointer走过Linked末端,说明Linked无环,直接return null;
.TIPS: If there is a ring,Two pointers will definitely meet。Because every time I go 1 wheel,fast and slow Pitch +1,fast The event will catch up slow; b. Second result: whenfast == slowhour, Two pointers in the ring First encounter 。下面分析此hourfast and slowPassing step数关系 :
.设Linked共have a+b Node,in Linked头部到Linked入口 have a Node(不计Linked入口节点), Linked环 have b Node(这里需要Notice,a and b yes未知数,例如图解上Linked a=4 , b=5);Set two pointers分别走了 f,s step,则have: a. fast 走的step数yesslowstep数的 2 Double,Right now f=2s;(Analyze: fast Walk per round 2 step) b.fast Compare slowGo more n Length of a ring,Right now f=s+nb;( Analyze: Double pointers have gone through a step,然后在环Inside绕圈直到重合,重合hour fast Compare slow Go 环的长度整数Double ); .The above two types are reduced:f=2nb,s=nb,Right nowfastandslow The pointer left separately 2n,n indivual Circumference of the ring (Notice: n yes未知数,不同Linked的情况不同)。
Current situation analysis:
.if让pointer从Linked头部一直向前走并统计step数k,那么所have 走到Linked入口节点hour的step数 yes:k=a+nb(Leave first a step到入口节点,Over time 1 Ring( b step)I will go to the entrance node again)。
..Current,slow pointerPassingstep数为 nb step。therefore,We just find a way slow Go again a step停下来,You can get to the entrance to the ring。
…但yes我们不知道 a Value,what to do?依然yes使用双pointer法。我们构建一indivualpointer,此pointer需要have以下性质:此pointerandslow Go forward together a step后,The two nodes at the entrance re -coincide。So where does it need to get to the entrance node? a step?答案yesLinked头部head。
Double pointer met for the second time: .slowpointer Unchanged position ,Willfastpointer重新 指向Linked头部节点 ;slowandfast同hour每wheel向前走 1 step;
..TIPS:此hour f=0,s=nb ; …when fast pointer走到f=a stephour,slow pointer走到steps=a+nb,此hour 两pointer重合,并同hour指向Linked环入口 。
returnslowpointer指向的节点。
Complexity analysis:
hour间复杂度 O(N) :In the second encounter,慢pointer须走step数 a<a+b;First encounter中,慢pointer须走step数 a+b−x<a+b,in x 为双pointer重合点and环入口距离;therefore总体为线性复杂度; Spatial complexity O(1) :双pointer使用常数大小的额外空间。
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
classSolution: defdetectCycle(self, head: Optional[ListNode]) -> Optional[ListNode]: a = head b = head whileTrue: ifnot b ornot b.next: returnNone a = a.next b = b.next.next if b == a: break b = head while a != b: a, b = a.next, b.next return b
classSolution { public: ListNode *detectCycle(ListNode *head){ ListNode *a = head; ListNode *b = head; while (true) { if (!b or !b->next) { returnnullptr; } a = a->next; b = b->next->next; //becauseb每次走两step,soabMust meet if (a == b) { break; } } // After meetingaWait in placeb, b去Linked头部 b = head; while(a!=b){ a = a->next; b = b->next; }
return a; } };
]]>
-
-
- <p><img src="../assets/img/2023-01-22%20(3).png" alt="2023-01-22 (3).png"></p>
-<h1 id="Thought:"><a href="#Thought:" class="headerlink" titl
-
+ <p><img src="../assets/img/2023-07-01%20(1).png" alt="2023-07-01 (1).png"><br><a href="https://leetcode.cn/problems/linked-list-cycle-ii/">142.Ring listII.md</a></p>
+<h1 id="Thought:"><a href="#Thought:" class="headerlink" title="Thought:"></a>Thought:</h1><h3 id="Problem-solving:"><a href="#Problem-solving:" class="headerlink" title="Problem -solving:"></a>Problem -solving:</h3><p>这类Linkedtopic一般都yes使用双pointer法解决的,For example, looking for distance tail K Node、Find a ring entrance、Find the entrance of the public tail, etc.。</p>
+<h3 id="Algorithm:"><a href="#Algorithm:" class="headerlink" title="Algorithm:"></a>Algorithm:</h3><ol>
+<li><p>Double pointer met for the first time: Set two pointers fast,slow 指向Linked头部 head,fast Walk per round 2 step,slow Walk per round 1 step;</p>
+<p> a. First result: fast pointer走过Linked末端,说明Linked无环,直接return null;</p>
+<p> .TIPS: If there is a ring,Two pointers will definitely meet。Because every time I go 1 wheel,fast and slow Pitch +1,fast The event will catch up slow;<br> b. Second result: whenfast == slowhour, Two pointers in the ring First encounter 。下面分析此hourfast and slowPassing step数关系 :</p>
+<p> .设Linked共have a+b Node,in Linked头部到Linked入口 have a Node(不计Linked入口节点), Linked环 have b Node(这里需要Notice,a and b yes未知数,例如图解上Linked a=4 , b=5);Set two pointers分别走了 f,s step,则have:<br> a. fast 走的step数yesslowstep数的 2 Double,Right now f=2s;(Analyze: fast Walk per round 2 step)<br> b.fast Compare slowGo more n Length of a ring,Right now f=s+nb;( Analyze: Double pointers have gone through a step,然后在环Inside绕圈直到重合,重合hour fast Compare slow Go 环的长度整数Double );<br> .The above two types are reduced:f=2nb,s=nb,Right nowfastandslow The pointer left separately 2n,n indivual Circumference of the ring (Notice: n yes未知数,不同Linked的情况不同)。</p>
+</li>
+</ol>
@@ -450,8 +452,6 @@
-
-
diff --git a/baidusitemap.xml b/baidusitemap.xml
index 9ecb386f0..ce89f2b3f 100644
--- a/baidusitemap.xml
+++ b/baidusitemap.xml
@@ -1,11 +1,11 @@
- https://longsizhuo.github.io/post/ac786f6f.html
+ https://longsizhuo.github.io/post/becdc081.html2024-09-18
- https://longsizhuo.github.io/post/becdc081.html
+ https://longsizhuo.github.io/post/ac786f6f.html2024-09-18
@@ -117,11 +117,11 @@
2024-09-10
- https://longsizhuo.github.io/post/a386fcdc.html
+ https://longsizhuo.github.io/post/2280b647.html2024-09-10
- https://longsizhuo.github.io/post/2280b647.html
+ https://longsizhuo.github.io/post/a386fcdc.html2024-09-10
@@ -277,15 +277,15 @@
2024-09-10
- https://longsizhuo.github.io/post/e03edda.html
+ https://longsizhuo.github.io/post/16b0e9f1.html2024-09-10
- https://longsizhuo.github.io/post/c3f7f59f.html
+ https://longsizhuo.github.io/post/e03edda.html2024-09-10
- https://longsizhuo.github.io/post/16b0e9f1.html
+ https://longsizhuo.github.io/post/c3f7f59f.html2024-09-10
@@ -297,11 +297,11 @@
2024-09-10
- https://longsizhuo.github.io/post/3277549c.html
+ https://longsizhuo.github.io/post/6be57ef7.html2024-09-10
- https://longsizhuo.github.io/post/6be57ef7.html
+ https://longsizhuo.github.io/post/3277549c.html2024-09-10
@@ -321,19 +321,19 @@
2024-09-10
- https://longsizhuo.github.io/post/d482ac75.html
+ https://longsizhuo.github.io/post/1978f474.html2024-09-10
- https://longsizhuo.github.io/post/3667cd44.html
+ https://longsizhuo.github.io/post/d482ac75.html2024-09-10
- https://longsizhuo.github.io/post/2f3e8e26.html
+ https://longsizhuo.github.io/post/3667cd44.html2024-09-10
- https://longsizhuo.github.io/post/1978f474.html
+ https://longsizhuo.github.io/post/2f3e8e26.html2024-09-10
@@ -353,11 +353,11 @@
2024-09-10
- https://longsizhuo.github.io/post/e2c9cca9.html
+ https://longsizhuo.github.io/post/b2a927d5.html2024-09-10
- https://longsizhuo.github.io/post/b2a927d5.html
+ https://longsizhuo.github.io/post/e2c9cca9.html2024-09-10
@@ -381,11 +381,11 @@
2024-09-10
- https://longsizhuo.github.io/post/a5d1dfda.html
+ https://longsizhuo.github.io/post/80cafdc8.html2024-09-10
- https://longsizhuo.github.io/post/80cafdc8.html
+ https://longsizhuo.github.io/post/a5d1dfda.html2024-09-10
@@ -393,11 +393,11 @@
2024-09-10
- https://longsizhuo.github.io/post/6610c769.html
+ https://longsizhuo.github.io/post/eb193c1f.html2024-09-10
- https://longsizhuo.github.io/post/eb193c1f.html
+ https://longsizhuo.github.io/post/6610c769.html2024-09-10
diff --git a/categories/Python/Hash-table/index.html b/categories/Python/Hash-table/index.html
index b9b2d3258..85099586d 100644
--- a/categories/Python/Hash-table/index.html
+++ b/categories/Python/Hash-table/index.html
@@ -414,7 +414,7 @@
104 篇|
- 33.6k
+ 33.9k
diff --git a/content.json b/content.json
index 6bf7dcf16..0a15249c6 100644
--- a/content.json
+++ b/content.json
@@ -1 +1 @@
-[{"title":"9021_TUT_2","date":"2024-09-18T01:00:36.787Z","path":"post/becdc081.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"Tutorial","slug":"Tutorial","permalink":"https://longsizhuo.github.io/tags/Tutorial/"}]},{"title":"Top of an article","date":"2024-09-10T15:11:32.940Z","path":"post/edc2b94.html","excerpt":"","tags":[{"name":"unsolved","slug":"unsolved","permalink":"https://longsizhuo.github.io/tags/unsolved/"},{"name":"front end","slug":"front-end","permalink":"https://longsizhuo.github.io/tags/front-end/"}]},{"title":"9021_TUT_1","date":"2024-09-10T14:00:00.000Z","path":"post/ac786f6f.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"Tutorial","slug":"Tutorial","permalink":"https://longsizhuo.github.io/tags/Tutorial/"}]},{"title":"964E","date":"2024-08-06T17:34:00.000Z","path":"post/2280b647.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"Answer","slug":"Answer","permalink":"https://longsizhuo.github.io/tags/Answer/"}]},{"title":"56. Merge Intervals","date":"2024-05-27T13:48:54.582Z","path":"post/50818339.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"数组","slug":"数组","permalink":"https://longsizhuo.github.io/tags/%E6%95%B0%E7%BB%84/"},{"name":"排序","slug":"排序","permalink":"https://longsizhuo.github.io/tags/%E6%8E%92%E5%BA%8F/"}]},{"title":"994.Rotten orange","date":"2024-05-13T14:00:00.000Z","path":"post/56e64fdd.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"BFS","slug":"BFS","permalink":"https://longsizhuo.github.io/tags/BFS/"},{"name":"Bilateral queue","slug":"Bilateral-queue","permalink":"https://longsizhuo.github.io/tags/Bilateral-queue/"}]},{"title":"1017. Negative binary conversion","date":"2023-12-31T13:00:00.000Z","path":"post/dce95dce.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"1124. The longest period of performance One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/a5d1dfda.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Prefix and","slug":"Prefix-and","permalink":"https://longsizhuo.github.io/tags/Prefix-and/"}]},{"title":"1017.Negative binary conversion","date":"2023-12-31T13:00:00.000Z","path":"post/80cafdc8.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"1138. The path on the letter board One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/fd471847.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"1233Delete the subfolder folder One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/6610c769.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Dictionary tree","slug":"Dictionary-tree","permalink":"https://longsizhuo.github.io/tags/Dictionary-tree/"}]},{"title":"1139. The greatest 1 Formation of the border One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/eb193c1f.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Prefix and","slug":"Prefix-and","permalink":"https://longsizhuo.github.io/tags/Prefix-and/"}]},{"title":"1234. Replace the sub -string to get a balanced string One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/56d97dcf.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"1237. Find out the positive combination of the given square One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/14b94db7.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"1250. examine「Good array」 One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/435a9a0d.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"math","slug":"math","permalink":"https://longsizhuo.github.io/tags/math/"}]},{"title":"142.Ring linkedII","date":"2023-12-31T13:00:00.000Z","path":"post/e2c9cca9.html","excerpt":"142.Ring listII.md Thought:Problem -solving:这类Linkedtopic一般都yes使用双pointer法解决的,For example, looking for distance tail K Node、Find a ring entrance、Find the entrance of the public tail, etc.。 Algorithm: Double pointer met for the first time: Set two pointers fast,slow 指向Linked头部 head,fast Walk per round 2 step,slow Walk per round 1 step; a. First result: fast pointer走过Linked末端,说明Linked无环,直接return null; .TIPS: If there is a ring,Two pointers will definitely meet。Because every time I go 1 wheel,fast and slow Pitch +1,fast The event will catch up slow; b. Second result: whenfast == slowhour, Two pointers in the ring First encounter 。下面分析此hourfast and slowPassing step数关系 : .设Linked共have a+b Node,in Linked头部到Linked入口 have a Node(不计Linked入口节点), Linked环 have b Node(这里需要Notice,a and b yes未知数,例如图解上Linked a=4 , b=5);Set two pointers分别走了 f,s step,则have: a. fast 走的step数yesslowstep数的 2 Double,Right now f=2s;(Analyze: fast Walk per round 2 step) b.fast Compare slowGo more n Length of a ring,Right now f=s+nb;( Analyze: Double pointers have gone through a step,然后在环Inside绕圈直到重合,重合hour fast Compare slow Go 环的长度整数Double ); .The above two types are reduced:f=2nb,s=nb,Right nowfastandslow The pointer left separately 2n,n indivual Circumference of the ring (Notice: n yes未知数,不同Linked的情况不同)。","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"1551. Make all the minimum operations of all elements in the array","date":"2023-12-31T13:00:00.000Z","path":"post/b2a927d5.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"math","slug":"math","permalink":"https://longsizhuo.github.io/tags/math/"}]},{"title":"1590.Make the array and energyPDivide","date":"2023-12-31T13:00:00.000Z","path":"post/59825e1f.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"1604Warn alert person who uses the same employee card within one hour One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/bb7bcf54.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Hash table","slug":"Hash-table","permalink":"https://longsizhuo.github.io/tags/Hash-table/"}]},{"title":"1653. The minimum number of times to balance the string balance","date":"2023-12-31T13:00:00.000Z","path":"post/cac21f27.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"1663. The smallest string with a given value One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/4d7252f8.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"One question daily","slug":"One-question-daily","permalink":"https://longsizhuo.github.io/tags/One-question-daily/"}]},{"title":"1669. Merge two linked watches One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/d482ac75.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"One question daily","slug":"One-question-daily","permalink":"https://longsizhuo.github.io/tags/One-question-daily/"},{"name":"Linked","slug":"Linked","permalink":"https://longsizhuo.github.io/tags/Linked/"}]},{"title":"1798You can construct the maximum number of continuity One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/3667cd44.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"golang","slug":"golang","permalink":"https://longsizhuo.github.io/tags/golang/"}]},{"title":"1801-1803 Liech buckle novice!","date":"2023-12-31T13:00:00.000Z","path":"post/2f3e8e26.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"solved,answer","slug":"solved-answer","permalink":"https://longsizhuo.github.io/tags/solved-answer/"}]},{"title":"1664. Number of schemes to generate balance numbers One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/1978f474.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"One question daily","slug":"One-question-daily","permalink":"https://longsizhuo.github.io/tags/One-question-daily/"},{"name":"Dynamic planning","slug":"Dynamic-planning","permalink":"https://longsizhuo.github.io/tags/Dynamic-planning/"}]},{"title":"1813. Sentence similarity III","date":"2023-12-31T13:00:00.000Z","path":"post/69c2a1dd.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"unsolved","slug":"unsolved","permalink":"https://longsizhuo.github.io/tags/unsolved/"},{"name":"Double pointer","slug":"Double-pointer","permalink":"https://longsizhuo.github.io/tags/Double-pointer/"}]},{"title":"1814. Statistics the number of good pairs in an array One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/ceb1e67f.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"Hash table","slug":"Hash-table","permalink":"https://longsizhuo.github.io/tags/Hash-table/"},{"name":"Double pointer","slug":"Double-pointer","permalink":"https://longsizhuo.github.io/tags/Double-pointer/"},{"name":"solved","slug":"solved","permalink":"https://longsizhuo.github.io/tags/solved/"}]},{"title":"1817. Find the number of users of users active One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/d0a9337b.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Hash table","slug":"Hash-table","permalink":"https://longsizhuo.github.io/tags/Hash-table/"}]},{"title":"1819.Different numbers in the sequence","date":"2023-12-31T13:00:00.000Z","path":"post/de522cea.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"unsolved","slug":"unsolved","permalink":"https://longsizhuo.github.io/tags/unsolved/"},{"name":"difficulty","slug":"difficulty","permalink":"https://longsizhuo.github.io/tags/difficulty/"}]},{"title":"1825. Seek out MK average value","date":"2023-12-31T13:00:00.000Z","path":"post/6be57ef7.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"unsolved","slug":"unsolved","permalink":"https://longsizhuo.github.io/tags/unsolved/"},{"name":"difficulty","slug":"difficulty","permalink":"https://longsizhuo.github.io/tags/difficulty/"},{"name":"Graph Theory","slug":"Graph-Theory","permalink":"https://longsizhuo.github.io/tags/Graph-Theory/"}]},{"title":"1828. Statistics the number of a circle mid -point One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/3277549c.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"math","slug":"math","permalink":"https://longsizhuo.github.io/tags/math/"}]},{"title":"1825. Seek out MK average value","date":"2023-12-31T13:00:00.000Z","path":"post/6be57ef7.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"unsolved","slug":"unsolved","permalink":"https://longsizhuo.github.io/tags/unsolved/"},{"name":"difficulty","slug":"difficulty","permalink":"https://longsizhuo.github.io/tags/difficulty/"},{"name":"Multiple set","slug":"Multiple-set","permalink":"https://longsizhuo.github.io/tags/Multiple-set/"}]},{"title":"19.Delete the countdown of the linked listNNode","date":"2023-12-31T13:00:00.000Z","path":"post/c916b663.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"PythonCoincidence,Random algorithmO(nlogn)Push","date":"2023-12-31T13:00:00.000Z","path":"post/a1d26db4.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"solved,answer","slug":"solved-answer","permalink":"https://longsizhuo.github.io/tags/solved-answer/"}]},{"title":"209.Small length array","date":"2023-12-31T13:00:00.000Z","path":"post/e6227611.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"217. Existing duplicate elements C++/Python3","date":"2023-12-31T13:00:00.000Z","path":"post/717042a6.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"solved,answer","slug":"solved-answer","permalink":"https://longsizhuo.github.io/tags/solved-answer/"},{"name":"Hash table","slug":"Hash-table","permalink":"https://longsizhuo.github.io/tags/Hash-table/"},{"name":"C++","slug":"C","permalink":"https://longsizhuo.github.io/tags/C/"}]},{"title":"217. Existing duplicate elements C++/Python3","date":"2023-12-31T13:00:00.000Z","path":"post/717042a6.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"solved,answer","slug":"solved-answer","permalink":"https://longsizhuo.github.io/tags/solved-answer/"},{"name":"Hash table","slug":"Hash-table","permalink":"https://longsizhuo.github.io/tags/Hash-table/"},{"name":"C++","slug":"C","permalink":"https://longsizhuo.github.io/tags/C/"}]},{"title":"221Maximum square","date":"2023-12-31T13:00:00.000Z","path":"post/e03edda.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"golang","slug":"golang","permalink":"https://longsizhuo.github.io/tags/golang/"},{"name":"Dynamic planning","slug":"Dynamic-planning","permalink":"https://longsizhuo.github.io/tags/Dynamic-planning/"}]},{"title":"One question daily 2283","date":"2023-12-31T13:00:00.000Z","path":"post/c3f7f59f.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"solved,answer","slug":"solved-answer","permalink":"https://longsizhuo.github.io/tags/solved-answer/"}]},{"title":"219.Existing duplicate elements II Hash table graphics","date":"2023-12-31T13:00:00.000Z","path":"post/16b0e9f1.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"solved","slug":"solved","permalink":"https://longsizhuo.github.io/tags/solved/"}]},{"title":"One question daily 2299. Code inspection device II","date":"2023-12-31T13:00:00.000Z","path":"post/7ded25bb.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Bit operation","slug":"Bit-operation","permalink":"https://longsizhuo.github.io/tags/Bit-operation/"}]},{"title":"One question daily 2293. Great mini game","date":"2023-12-31T13:00:00.000Z","path":"post/9df6242c.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"solved,answer","slug":"solved-answer","permalink":"https://longsizhuo.github.io/tags/solved-answer/"}]},{"title":"2303. Calculate the total taxable amount","date":"2023-12-31T13:00:00.000Z","path":"post/11597f8b.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"math","slug":"math","permalink":"https://longsizhuo.github.io/tags/math/"},{"name":"unsolved","slug":"unsolved","permalink":"https://longsizhuo.github.io/tags/unsolved/"}]},{"title":"2309. The best English letters with both appropriates and lowercases One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/b4953d62.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Hash table","slug":"Hash-table","permalink":"https://longsizhuo.github.io/tags/Hash-table/"},{"name":"One question daily","slug":"One-question-daily","permalink":"https://longsizhuo.github.io/tags/One-question-daily/"},{"name":"C++","slug":"C","permalink":"https://longsizhuo.github.io/tags/C/"},{"name":"Bit operation","slug":"Bit-operation","permalink":"https://longsizhuo.github.io/tags/Bit-operation/"}]},{"title":"2315. Statistical star number One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/dc8d7590.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"One question daily","slug":"One-question-daily","permalink":"https://longsizhuo.github.io/tags/One-question-daily/"}]},{"title":"2319Determine whether the matrix is one X matrix One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/f7c5db77.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"2325Decrypt One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/f4b99a74.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Hash table","slug":"Hash-table","permalink":"https://longsizhuo.github.io/tags/Hash-table/"},{"name":"One question daily","slug":"One-question-daily","permalink":"https://longsizhuo.github.io/tags/One-question-daily/"},{"name":"golang","slug":"golang","permalink":"https://longsizhuo.github.io/tags/golang/"}]},{"title":"2331Calculate the value of the Boolean binary tree One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/a564ea0e.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Binary tree","slug":"Binary-tree","permalink":"https://longsizhuo.github.io/tags/Binary-tree/"}]},{"title":"2335. The shortest total time to be filled with a cup One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/4400daa1.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"One question daily","slug":"One-question-daily","permalink":"https://longsizhuo.github.io/tags/One-question-daily/"},{"name":"golang","slug":"golang","permalink":"https://longsizhuo.github.io/tags/golang/"},{"name":"dp","slug":"dp","permalink":"https://longsizhuo.github.io/tags/dp/"}]},{"title":"2341. How much can the array be formed One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/f953c753.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"24.Two or two exchanges linked watches","date":"2023-12-31T13:00:00.000Z","path":"post/d030a5a0.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"2527.Query arrayXorBeautiful value Zhou Sai Third Question","date":"2023-12-31T13:00:00.000Z","path":"post/20ffa67a.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"solved,answer","slug":"solved-answer","permalink":"https://longsizhuo.github.io/tags/solved-answer/"}]},{"title":"2639. Query the width of each column in the grid diagram","date":"2023-12-31T13:00:00.000Z","path":"post/5a764983.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"2679.In the matrix and the harmony","date":"2023-12-31T13:00:00.000Z","path":"post/5277100.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Array","slug":"Array","permalink":"https://longsizhuo.github.io/tags/Array/"},{"name":"matrix","slug":"matrix","permalink":"https://longsizhuo.github.io/tags/matrix/"},{"name":"Sort","slug":"Sort","permalink":"https://longsizhuo.github.io/tags/Sort/"},{"name":"simulation","slug":"simulation","permalink":"https://longsizhuo.github.io/tags/simulation/"},{"name":"heap(Priority queue)","slug":"heap(Priority-queue)","permalink":"https://longsizhuo.github.io/tags/heap%EF%BC%88Priority-queue%EF%BC%89/"}]},{"title":"271. Code and decoding of string - Python Add the transposition symbol solution method Dual complexityO(n)","date":"2023-12-31T13:00:00.000Z","path":"post/5992f238.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"solved,answer","slug":"solved-answer","permalink":"https://longsizhuo.github.io/tags/solved-answer/"}]},{"title":"2997. Make an array or harmony K The minimum number of operations","date":"2023-12-31T13:00:00.000Z","path":"post/3109a910.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"solved","slug":"solved","permalink":"https://longsizhuo.github.io/tags/solved/"},{"name":"Bit operation","slug":"Bit-operation","permalink":"https://longsizhuo.github.io/tags/Bit-operation/"}]},{"title":"2998. make X and Y Equal number of operations","date":"2023-12-31T13:00:00.000Z","path":"post/5ee4164.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"Dynamic planning","slug":"Dynamic-planning","permalink":"https://longsizhuo.github.io/tags/Dynamic-planning/"},{"name":"Priority search","slug":"Priority-search","permalink":"https://longsizhuo.github.io/tags/Priority-search/"},{"name":"Memory search","slug":"Memory-search","permalink":"https://longsizhuo.github.io/tags/Memory-search/"}]},{"title":"3072. Allocate elements into two arrays II","date":"2023-12-31T13:00:00.000Z","path":"post/48a38683.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Array","slug":"Array","permalink":"https://longsizhuo.github.io/tags/Array/"},{"name":"simulation","slug":"simulation","permalink":"https://longsizhuo.github.io/tags/simulation/"},{"name":"Tree array","slug":"Tree-array","permalink":"https://longsizhuo.github.io/tags/Tree-array/"},{"name":"Thread tree","slug":"Thread-tree","permalink":"https://longsizhuo.github.io/tags/Thread-tree/"}]},{"title":"345. Voice letter in the reverse string","date":"2023-12-31T13:00:00.000Z","path":"post/1c57c22c.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"350.The intersection of two array","date":"2023-12-31T13:00:00.000Z","path":"post/616577aa.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"Hash table","slug":"Hash-table","permalink":"https://longsizhuo.github.io/tags/Hash-table/"},{"name":"Double pointer","slug":"Double-pointer","permalink":"https://longsizhuo.github.io/tags/Double-pointer/"},{"name":"solved","slug":"solved","permalink":"https://longsizhuo.github.io/tags/solved/"}]},{"title":"445.Two numbersII","date":"2023-12-31T13:00:00.000Z","path":"post/2c4cc46c.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"math","slug":"math","permalink":"https://longsizhuo.github.io/tags/math/"},{"name":"Linked","slug":"Linked","permalink":"https://longsizhuo.github.io/tags/Linked/"},{"name":"recursion","slug":"recursion","permalink":"https://longsizhuo.github.io/tags/recursion/"},{"name":"Stack","slug":"Stack","permalink":"https://longsizhuo.github.io/tags/Stack/"}]},{"title":"538.Convert the binary search tree to cumulative tree","date":"2023-12-31T13:00:00.000Z","path":"post/32401b69.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Binary tree","slug":"Binary-tree","permalink":"https://longsizhuo.github.io/tags/Binary-tree/"}]},{"title":"6275. Make all the minimum operations of all elements in the array II","date":"2023-12-31T13:00:00.000Z","path":"post/4e14482b.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"greedy","slug":"greedy","permalink":"https://longsizhuo.github.io/tags/greedy/"}]},{"title":"6293. Count the number of good array","date":"2023-12-31T13:00:00.000Z","path":"post/81004405.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"unsolved","slug":"unsolved","permalink":"https://longsizhuo.github.io/tags/unsolved/"}]},{"title":"6300. Minimum public value","date":"2023-12-31T13:00:00.000Z","path":"post/fefe18d8.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"6323. Child that divides money the most","date":"2023-12-31T13:00:00.000Z","path":"post/b9130c0e.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"6324. Maximize the great value of the array","date":"2023-12-31T13:00:00.000Z","path":"post/1e6b72b8.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"6331The most prizes won in the two lines make()usage","date":"2023-12-31T13:00:00.000Z","path":"post/14d9382b.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"golang","slug":"golang","permalink":"https://longsizhuo.github.io/tags/golang/"}]},{"title":"6338. Number of methods of monkey collision Weekly","date":"2023-12-31T13:00:00.000Z","path":"post/2aa720ec.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"math","slug":"math","permalink":"https://longsizhuo.github.io/tags/math/"},{"name":"Fast power","slug":"Fast-power","permalink":"https://longsizhuo.github.io/tags/Fast-power/"},{"name":"Weekly","slug":"Weekly","permalink":"https://longsizhuo.github.io/tags/Weekly/"}]},{"title":"6347Number of vowel string within the scope of statistics","date":"2023-12-31T13:00:00.000Z","path":"post/52923acb.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"6351. The scores of the array after the marking all elements","date":"2023-12-31T13:00:00.000Z","path":"post/20116270.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"704. Two -point search","date":"2023-12-31T13:00:00.000Z","path":"post/41f30363.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"76Minimum cover string","date":"2023-12-31T13:00:00.000Z","path":"post/ae10d3c1.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"difficulty","slug":"difficulty","permalink":"https://longsizhuo.github.io/tags/difficulty/"}]},{"title":"Python beat98.40% collectionsofCounter method!","date":"2023-12-31T13:00:00.000Z","path":"post/73b5ce9c.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"solved,answer","slug":"solved-answer","permalink":"https://longsizhuo.github.io/tags/solved-answer/"}]},{"title":"977.Orderly array square","date":"2023-12-31T13:00:00.000Z","path":"post/a386fcdc.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"Sword finger Offer 43. 1~n Integer 1 Number of times","date":"2023-12-31T13:00:00.000Z","path":"post/f0d96a1f.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"solved","slug":"solved","permalink":"https://longsizhuo.github.io/tags/solved/"},{"name":"difficulty","slug":"difficulty","permalink":"https://longsizhuo.github.io/tags/difficulty/"}]},{"title":"121.The best time for buying and selling stocks","date":"2023-12-31T13:00:00.000Z","path":"post/3a21fe32.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Dynamic planning","slug":"Dynamic-planning","permalink":"https://longsizhuo.github.io/tags/Dynamic-planning/"},{"name":"Array","slug":"Array","permalink":"https://longsizhuo.github.io/tags/Array/"}]},{"title":"1222.Can attack the queen of the king","date":"2023-12-31T13:00:00.000Z","path":"post/a6577367.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Array","slug":"Array","permalink":"https://longsizhuo.github.io/tags/Array/"},{"name":"matrix","slug":"matrix","permalink":"https://longsizhuo.github.io/tags/matrix/"},{"name":"simulation","slug":"simulation","permalink":"https://longsizhuo.github.io/tags/simulation/"}]},{"title":"122.The best time for buying and selling stocksII","date":"2023-12-31T13:00:00.000Z","path":"post/a75da5a.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Dynamic planning","slug":"Dynamic-planning","permalink":"https://longsizhuo.github.io/tags/Dynamic-planning/"},{"name":"Array","slug":"Array","permalink":"https://longsizhuo.github.io/tags/Array/"},{"name":"greedy","slug":"greedy","permalink":"https://longsizhuo.github.io/tags/greedy/"}]},{"title":"1253.Reconstruct 2 Line binary matrix","date":"2023-12-31T13:00:00.000Z","path":"post/5c98e66b.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Array","slug":"Array","permalink":"https://longsizhuo.github.io/tags/Array/"},{"name":"matrix","slug":"matrix","permalink":"https://longsizhuo.github.io/tags/matrix/"},{"name":"greedy","slug":"greedy","permalink":"https://longsizhuo.github.io/tags/greedy/"},{"name":"medium","slug":"medium","permalink":"https://longsizhuo.github.io/tags/medium/"}]},{"title":"1333.Restaurant filter","date":"2023-12-31T13:00:00.000Z","path":"post/7f1331bc.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Array","slug":"Array","permalink":"https://longsizhuo.github.io/tags/Array/"},{"name":"Sort","slug":"Sort","permalink":"https://longsizhuo.github.io/tags/Sort/"}]},{"title":"1460.Class ScheduleIV","date":"2023-12-31T13:00:00.000Z","path":"post/d8b8a149.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Priority search","slug":"Priority-search","permalink":"https://longsizhuo.github.io/tags/Priority-search/"},{"name":"In -depth priority search","slug":"In-depth-priority-search","permalink":"https://longsizhuo.github.io/tags/In-depth-priority-search/"},{"name":"picture","slug":"picture","permalink":"https://longsizhuo.github.io/tags/picture/"},{"name":"Topology","slug":"Topology","permalink":"https://longsizhuo.github.io/tags/Topology/"}]},{"title":"146.LRU cache","date":"2023-12-31T13:00:00.000Z","path":"post/b9130c0e.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Hash table","slug":"Hash-table","permalink":"https://longsizhuo.github.io/tags/Hash-table/"},{"name":"Linked","slug":"Linked","permalink":"https://longsizhuo.github.io/tags/Linked/"},{"name":"design","slug":"design","permalink":"https://longsizhuo.github.io/tags/design/"},{"name":"双向Linked","slug":"双向Linked","permalink":"https://longsizhuo.github.io/tags/%E5%8F%8C%E5%90%91Linked/"}]},{"title":"213.Hiccup II","date":"2023-12-31T13:00:00.000Z","path":"post/85beb0bf.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Dynamic planning","slug":"Dynamic-planning","permalink":"https://longsizhuo.github.io/tags/Dynamic-planning/"},{"name":"Array","slug":"Array","permalink":"https://longsizhuo.github.io/tags/Array/"}]},{"title":"2251.The number of flowers during the flowering period","date":"2023-12-31T13:00:00.000Z","path":"post/3a21fe32.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Prefix and","slug":"Prefix-and","permalink":"https://longsizhuo.github.io/tags/Prefix-and/"},{"name":"Hash table","slug":"Hash-table","permalink":"https://longsizhuo.github.io/tags/Hash-table/"},{"name":"Array","slug":"Array","permalink":"https://longsizhuo.github.io/tags/Array/"},{"name":"Sort","slug":"Sort","permalink":"https://longsizhuo.github.io/tags/Sort/"},{"name":"Two -point search","slug":"Two-point-search","permalink":"https://longsizhuo.github.io/tags/Two-point-search/"},{"name":"Orderly collection","slug":"Orderly-collection","permalink":"https://longsizhuo.github.io/tags/Orderly-collection/"}]},{"title":"2490Return ring sentence","date":"2023-12-31T13:00:00.000Z","path":"post/5c07686c.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"String","slug":"String","permalink":"https://longsizhuo.github.io/tags/String/"}]},{"title":"2562.Find the series of the array","date":"2023-12-31T13:00:00.000Z","path":"post/b625a0e1.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Double pointer","slug":"Double-pointer","permalink":"https://longsizhuo.github.io/tags/Double-pointer/"},{"name":"Array","slug":"Array","permalink":"https://longsizhuo.github.io/tags/Array/"},{"name":"simulation","slug":"simulation","permalink":"https://longsizhuo.github.io/tags/simulation/"}]},{"title":"2582.Pillow","date":"2023-12-31T13:00:00.000Z","path":"post/82e09f92.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"math","slug":"math","permalink":"https://longsizhuo.github.io/tags/math/"},{"name":"simulation","slug":"simulation","permalink":"https://longsizhuo.github.io/tags/simulation/"}]},{"title":"2591.Child that divides money the most","date":"2023-12-31T13:00:00.000Z","path":"post/6a9ab144.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"math","slug":"math","permalink":"https://longsizhuo.github.io/tags/math/"},{"name":"greedy","slug":"greedy","permalink":"https://longsizhuo.github.io/tags/greedy/"}]},{"title":"2596.Check the Cavaliers patrol plan","date":"2023-12-31T13:00:00.000Z","path":"post/29546b92.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Array","slug":"Array","permalink":"https://longsizhuo.github.io/tags/Array/"},{"name":"matrix","slug":"matrix","permalink":"https://longsizhuo.github.io/tags/matrix/"},{"name":"simulation","slug":"simulation","permalink":"https://longsizhuo.github.io/tags/simulation/"},{"name":"Priority search","slug":"Priority-search","permalink":"https://longsizhuo.github.io/tags/Priority-search/"},{"name":"In -depth priority search","slug":"In-depth-priority-search","permalink":"https://longsizhuo.github.io/tags/In-depth-priority-search/"}]},{"title":"2 .Two numbers","date":"2023-12-31T13:00:00.000Z","path":"post/fa9db6b8.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"math","slug":"math","permalink":"https://longsizhuo.github.io/tags/math/"},{"name":"Linked","slug":"Linked","permalink":"https://longsizhuo.github.io/tags/Linked/"},{"name":"recursion","slug":"recursion","permalink":"https://longsizhuo.github.io/tags/recursion/"}]},{"title":"213.Hiccup III","date":"2023-12-31T13:00:00.000Z","path":"post/86590614.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Dynamic planning","slug":"Dynamic-planning","permalink":"https://longsizhuo.github.io/tags/Dynamic-planning/"},{"name":"Binary tree","slug":"Binary-tree","permalink":"https://longsizhuo.github.io/tags/Binary-tree/"},{"name":"In -depth priority search","slug":"In-depth-priority-search","permalink":"https://longsizhuo.github.io/tags/In-depth-priority-search/"},{"name":"Tree","slug":"Tree","permalink":"https://longsizhuo.github.io/tags/Tree/"}]},{"title":"630.Class ScheduleIII","date":"2023-12-31T13:00:00.000Z","path":"post/e14241e.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"greedy","slug":"greedy","permalink":"https://longsizhuo.github.io/tags/greedy/"},{"name":"Priority queue","slug":"Priority-queue","permalink":"https://longsizhuo.github.io/tags/Priority-queue/"}]},{"title":"LCP 06.Coin","date":"2023-12-31T13:00:00.000Z","path":"post/66079b7b.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"math","slug":"math","permalink":"https://longsizhuo.github.io/tags/math/"},{"name":"Array","slug":"Array","permalink":"https://longsizhuo.github.io/tags/Array/"}]},{"title":"LCP 50.Gem supply","date":"2023-12-31T13:00:00.000Z","path":"post/762ca698.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Array","slug":"Array","permalink":"https://longsizhuo.github.io/tags/Array/"},{"name":"simulation","slug":"simulation","permalink":"https://longsizhuo.github.io/tags/simulation/"}]},{"title":"brief_alternate Assignment","date":"2023-12-31T13:00:00.000Z","path":"post/dbbd7d58.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"pandas","slug":"pandas","permalink":"https://longsizhuo.github.io/tags/pandas/"}]},{"title":"GOlanguage# GOlanguage可爱捏","date":"2023-12-31T13:00:00.000Z","path":"post/67fc8613.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"Inline expansion","date":"2023-12-31T13:00:00.000Z","path":"post/2660e935.html","excerpt":"","tags":[{"name":"Composition principle","slug":"Composition-principle","permalink":"https://longsizhuo.github.io/tags/Composition-principle/"}]},{"title":"Some doubt","date":"2023-12-31T13:00:00.000Z","path":"post/941aeb72.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"encryption","slug":"encryption","permalink":"https://longsizhuo.github.io/tags/encryption/"}]},{"title":"math","date":"2023-12-31T13:00:00.000Z","path":"post/a927044d.html","excerpt":"like $\\lim_{x \\to 0} \\frac{\\sin x}{x}$ Rendering $$\\begin{eqnarray} \\lim_{x \\to 0} \\frac{\\sin x + x^2 + x^3}{x} & = & \\lim_{x \\to 0} \\frac{\\sin x }{x} + \\lim_{x \\to 0} \\frac{x^2 }{x} + \\lim_{x \\to 0}\\frac{x^3}{x}\\\\ & = & \\lim_{x \\to 0}\\frac{\\sin x}{x}\\\\ & = & 1\\end{eqnarray}$$","tags":[{"name":"math","slug":"math","permalink":"https://longsizhuo.github.io/tags/math/"}]},{"title":"Sword finger Offer 68 - II. The recent public ancestor of the binary tree","date":"2023-12-31T13:00:00.000Z","path":"post/36f314aa.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"Sword finger Offer II 021. Delete the countdown of the linked list n Node","date":"2023-12-31T13:00:00.000Z","path":"post/3ed2f01c.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"2085. Public string that has occurred once","date":"2023-11-30T13:00:00.000Z","path":"post/bbe4bff6.html","excerpt":"","tags":[{"name":"Hash table","slug":"Hash-table","permalink":"https://longsizhuo.github.io/tags/Hash-table/"},{"name":"Array","slug":"Array","permalink":"https://longsizhuo.github.io/tags/Array/"},{"name":"String","slug":"String","permalink":"https://longsizhuo.github.io/tags/String/"},{"name":"count","slug":"count","permalink":"https://longsizhuo.github.io/tags/count/"}]},{"title":"1004.Maximum continuity1Number III Maximum continuity1Number III","date":"2022-12-06T14:15:00.000Z","path":"post/ed19b576.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"solved,answer","slug":"solved-answer","permalink":"https://longsizhuo.github.io/tags/solved-answer/"}]}]
\ No newline at end of file
+[{"title":"9021_TUT_2","date":"2024-09-18T01:00:36.787Z","path":"post/becdc081.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"Tutorial","slug":"Tutorial","permalink":"https://longsizhuo.github.io/tags/Tutorial/"}]},{"title":"Top of an article","date":"2024-09-10T15:11:32.940Z","path":"post/edc2b94.html","excerpt":"","tags":[{"name":"unsolved","slug":"unsolved","permalink":"https://longsizhuo.github.io/tags/unsolved/"},{"name":"front end","slug":"front-end","permalink":"https://longsizhuo.github.io/tags/front-end/"}]},{"title":"9021_TUT_1","date":"2024-09-10T14:00:00.000Z","path":"post/ac786f6f.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"Tutorial","slug":"Tutorial","permalink":"https://longsizhuo.github.io/tags/Tutorial/"}]},{"title":"964E","date":"2024-08-06T17:34:00.000Z","path":"post/2280b647.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"Answer","slug":"Answer","permalink":"https://longsizhuo.github.io/tags/Answer/"}]},{"title":"56. Merge Intervals","date":"2024-05-27T13:48:54.582Z","path":"post/50818339.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"数组","slug":"数组","permalink":"https://longsizhuo.github.io/tags/%E6%95%B0%E7%BB%84/"},{"name":"排序","slug":"排序","permalink":"https://longsizhuo.github.io/tags/%E6%8E%92%E5%BA%8F/"}]},{"title":"994.Rotten orange","date":"2024-05-13T14:00:00.000Z","path":"post/56e64fdd.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"BFS","slug":"BFS","permalink":"https://longsizhuo.github.io/tags/BFS/"},{"name":"Bilateral queue","slug":"Bilateral-queue","permalink":"https://longsizhuo.github.io/tags/Bilateral-queue/"}]},{"title":"1017. Negative binary conversion","date":"2023-12-31T13:00:00.000Z","path":"post/dce95dce.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"1017.Negative binary conversion","date":"2023-12-31T13:00:00.000Z","path":"post/80cafdc8.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"1124. The longest period of performance One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/a5d1dfda.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Prefix and","slug":"Prefix-and","permalink":"https://longsizhuo.github.io/tags/Prefix-and/"}]},{"title":"1138. The path on the letter board One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/fd471847.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"1139. The greatest 1 Formation of the border One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/eb193c1f.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Prefix and","slug":"Prefix-and","permalink":"https://longsizhuo.github.io/tags/Prefix-and/"}]},{"title":"1233Delete the subfolder folder One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/6610c769.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Dictionary tree","slug":"Dictionary-tree","permalink":"https://longsizhuo.github.io/tags/Dictionary-tree/"}]},{"title":"1234. Replace the sub -string to get a balanced string One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/56d97dcf.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"1237. Find out the positive combination of the given square One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/14b94db7.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"1250. examine「Good array」 One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/435a9a0d.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"math","slug":"math","permalink":"https://longsizhuo.github.io/tags/math/"}]},{"title":"1551. Make all the minimum operations of all elements in the array","date":"2023-12-31T13:00:00.000Z","path":"post/b2a927d5.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"math","slug":"math","permalink":"https://longsizhuo.github.io/tags/math/"}]},{"title":"142.Ring linkedII","date":"2023-12-31T13:00:00.000Z","path":"post/e2c9cca9.html","excerpt":"142.Ring listII.md Thought:Problem -solving:这类Linkedtopic一般都yes使用双pointer法解决的,For example, looking for distance tail K Node、Find a ring entrance、Find the entrance of the public tail, etc.。 Algorithm: Double pointer met for the first time: Set two pointers fast,slow 指向Linked头部 head,fast Walk per round 2 step,slow Walk per round 1 step; a. First result: fast pointer走过Linked末端,说明Linked无环,直接return null; .TIPS: If there is a ring,Two pointers will definitely meet。Because every time I go 1 wheel,fast and slow Pitch +1,fast The event will catch up slow; b. Second result: whenfast == slowhour, Two pointers in the ring First encounter 。下面分析此hourfast and slowPassing step数关系 : .设Linked共have a+b Node,in Linked头部到Linked入口 have a Node(不计Linked入口节点), Linked环 have b Node(这里需要Notice,a and b yes未知数,例如图解上Linked a=4 , b=5);Set two pointers分别走了 f,s step,则have: a. fast 走的step数yesslowstep数的 2 Double,Right now f=2s;(Analyze: fast Walk per round 2 step) b.fast Compare slowGo more n Length of a ring,Right now f=s+nb;( Analyze: Double pointers have gone through a step,然后在环Inside绕圈直到重合,重合hour fast Compare slow Go 环的长度整数Double ); .The above two types are reduced:f=2nb,s=nb,Right nowfastandslow The pointer left separately 2n,n indivual Circumference of the ring (Notice: n yes未知数,不同Linked的情况不同)。","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"1590.Make the array and energyPDivide","date":"2023-12-31T13:00:00.000Z","path":"post/59825e1f.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"1604Warn alert person who uses the same employee card within one hour One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/bb7bcf54.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Hash table","slug":"Hash-table","permalink":"https://longsizhuo.github.io/tags/Hash-table/"}]},{"title":"1653. The minimum number of times to balance the string balance","date":"2023-12-31T13:00:00.000Z","path":"post/cac21f27.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"1663. The smallest string with a given value One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/4d7252f8.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"One question daily","slug":"One-question-daily","permalink":"https://longsizhuo.github.io/tags/One-question-daily/"}]},{"title":"1664. Number of schemes to generate balance numbers One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/1978f474.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"One question daily","slug":"One-question-daily","permalink":"https://longsizhuo.github.io/tags/One-question-daily/"},{"name":"Dynamic planning","slug":"Dynamic-planning","permalink":"https://longsizhuo.github.io/tags/Dynamic-planning/"}]},{"title":"1669. Merge two linked watches One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/d482ac75.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"One question daily","slug":"One-question-daily","permalink":"https://longsizhuo.github.io/tags/One-question-daily/"},{"name":"Linked","slug":"Linked","permalink":"https://longsizhuo.github.io/tags/Linked/"}]},{"title":"1798You can construct the maximum number of continuity One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/3667cd44.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"golang","slug":"golang","permalink":"https://longsizhuo.github.io/tags/golang/"}]},{"title":"1801-1803 Liech buckle novice!","date":"2023-12-31T13:00:00.000Z","path":"post/2f3e8e26.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"solved,answer","slug":"solved-answer","permalink":"https://longsizhuo.github.io/tags/solved-answer/"}]},{"title":"1813. Sentence similarity III","date":"2023-12-31T13:00:00.000Z","path":"post/69c2a1dd.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"unsolved","slug":"unsolved","permalink":"https://longsizhuo.github.io/tags/unsolved/"},{"name":"Double pointer","slug":"Double-pointer","permalink":"https://longsizhuo.github.io/tags/Double-pointer/"}]},{"title":"1814. Statistics the number of good pairs in an array One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/ceb1e67f.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"Hash table","slug":"Hash-table","permalink":"https://longsizhuo.github.io/tags/Hash-table/"},{"name":"Double pointer","slug":"Double-pointer","permalink":"https://longsizhuo.github.io/tags/Double-pointer/"},{"name":"solved","slug":"solved","permalink":"https://longsizhuo.github.io/tags/solved/"}]},{"title":"1817. Find the number of users of users active One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/d0a9337b.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Hash table","slug":"Hash-table","permalink":"https://longsizhuo.github.io/tags/Hash-table/"}]},{"title":"1819.Different numbers in the sequence","date":"2023-12-31T13:00:00.000Z","path":"post/de522cea.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"unsolved","slug":"unsolved","permalink":"https://longsizhuo.github.io/tags/unsolved/"},{"name":"difficulty","slug":"difficulty","permalink":"https://longsizhuo.github.io/tags/difficulty/"}]},{"title":"1825. Seek out MK average value","date":"2023-12-31T13:00:00.000Z","path":"post/6be57ef7.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"unsolved","slug":"unsolved","permalink":"https://longsizhuo.github.io/tags/unsolved/"},{"name":"difficulty","slug":"difficulty","permalink":"https://longsizhuo.github.io/tags/difficulty/"},{"name":"Graph Theory","slug":"Graph-Theory","permalink":"https://longsizhuo.github.io/tags/Graph-Theory/"}]},{"title":"1825. Seek out MK average value","date":"2023-12-31T13:00:00.000Z","path":"post/6be57ef7.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"unsolved","slug":"unsolved","permalink":"https://longsizhuo.github.io/tags/unsolved/"},{"name":"difficulty","slug":"difficulty","permalink":"https://longsizhuo.github.io/tags/difficulty/"},{"name":"Multiple set","slug":"Multiple-set","permalink":"https://longsizhuo.github.io/tags/Multiple-set/"}]},{"title":"1828. Statistics the number of a circle mid -point One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/3277549c.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"math","slug":"math","permalink":"https://longsizhuo.github.io/tags/math/"}]},{"title":"19.Delete the countdown of the linked listNNode","date":"2023-12-31T13:00:00.000Z","path":"post/c916b663.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"PythonCoincidence,Random algorithmO(nlogn)Push","date":"2023-12-31T13:00:00.000Z","path":"post/a1d26db4.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"solved,answer","slug":"solved-answer","permalink":"https://longsizhuo.github.io/tags/solved-answer/"}]},{"title":"209.Small length array","date":"2023-12-31T13:00:00.000Z","path":"post/e6227611.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"217. Existing duplicate elements C++/Python3","date":"2023-12-31T13:00:00.000Z","path":"post/717042a6.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"solved,answer","slug":"solved-answer","permalink":"https://longsizhuo.github.io/tags/solved-answer/"},{"name":"Hash table","slug":"Hash-table","permalink":"https://longsizhuo.github.io/tags/Hash-table/"},{"name":"C++","slug":"C","permalink":"https://longsizhuo.github.io/tags/C/"}]},{"title":"217. Existing duplicate elements C++/Python3","date":"2023-12-31T13:00:00.000Z","path":"post/717042a6.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"solved,answer","slug":"solved-answer","permalink":"https://longsizhuo.github.io/tags/solved-answer/"},{"name":"Hash table","slug":"Hash-table","permalink":"https://longsizhuo.github.io/tags/Hash-table/"},{"name":"C++","slug":"C","permalink":"https://longsizhuo.github.io/tags/C/"}]},{"title":"219.Existing duplicate elements II Hash table graphics","date":"2023-12-31T13:00:00.000Z","path":"post/16b0e9f1.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"solved","slug":"solved","permalink":"https://longsizhuo.github.io/tags/solved/"}]},{"title":"221Maximum square","date":"2023-12-31T13:00:00.000Z","path":"post/e03edda.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Dynamic planning","slug":"Dynamic-planning","permalink":"https://longsizhuo.github.io/tags/Dynamic-planning/"},{"name":"golang","slug":"golang","permalink":"https://longsizhuo.github.io/tags/golang/"}]},{"title":"One question daily 2283","date":"2023-12-31T13:00:00.000Z","path":"post/c3f7f59f.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"solved,answer","slug":"solved-answer","permalink":"https://longsizhuo.github.io/tags/solved-answer/"}]},{"title":"One question daily 2293. Great mini game","date":"2023-12-31T13:00:00.000Z","path":"post/9df6242c.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"solved,answer","slug":"solved-answer","permalink":"https://longsizhuo.github.io/tags/solved-answer/"}]},{"title":"One question daily 2299. Code inspection device II","date":"2023-12-31T13:00:00.000Z","path":"post/7ded25bb.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Bit operation","slug":"Bit-operation","permalink":"https://longsizhuo.github.io/tags/Bit-operation/"}]},{"title":"2303. Calculate the total taxable amount","date":"2023-12-31T13:00:00.000Z","path":"post/11597f8b.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"math","slug":"math","permalink":"https://longsizhuo.github.io/tags/math/"},{"name":"unsolved","slug":"unsolved","permalink":"https://longsizhuo.github.io/tags/unsolved/"}]},{"title":"2309. The best English letters with both appropriates and lowercases One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/b4953d62.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Hash table","slug":"Hash-table","permalink":"https://longsizhuo.github.io/tags/Hash-table/"},{"name":"One question daily","slug":"One-question-daily","permalink":"https://longsizhuo.github.io/tags/One-question-daily/"},{"name":"C++","slug":"C","permalink":"https://longsizhuo.github.io/tags/C/"},{"name":"Bit operation","slug":"Bit-operation","permalink":"https://longsizhuo.github.io/tags/Bit-operation/"}]},{"title":"2315. Statistical star number One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/dc8d7590.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"One question daily","slug":"One-question-daily","permalink":"https://longsizhuo.github.io/tags/One-question-daily/"}]},{"title":"2319Determine whether the matrix is one X matrix One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/f7c5db77.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"2325Decrypt One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/f4b99a74.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Hash table","slug":"Hash-table","permalink":"https://longsizhuo.github.io/tags/Hash-table/"},{"name":"One question daily","slug":"One-question-daily","permalink":"https://longsizhuo.github.io/tags/One-question-daily/"},{"name":"golang","slug":"golang","permalink":"https://longsizhuo.github.io/tags/golang/"}]},{"title":"2331Calculate the value of the Boolean binary tree One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/a564ea0e.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Binary tree","slug":"Binary-tree","permalink":"https://longsizhuo.github.io/tags/Binary-tree/"}]},{"title":"2335. The shortest total time to be filled with a cup One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/4400daa1.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"One question daily","slug":"One-question-daily","permalink":"https://longsizhuo.github.io/tags/One-question-daily/"},{"name":"golang","slug":"golang","permalink":"https://longsizhuo.github.io/tags/golang/"},{"name":"dp","slug":"dp","permalink":"https://longsizhuo.github.io/tags/dp/"}]},{"title":"2341. How much can the array be formed One question daily","date":"2023-12-31T13:00:00.000Z","path":"post/f953c753.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"24.Two or two exchanges linked watches","date":"2023-12-31T13:00:00.000Z","path":"post/d030a5a0.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"2527.Query arrayXorBeautiful value Zhou Sai Third Question","date":"2023-12-31T13:00:00.000Z","path":"post/20ffa67a.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"solved,answer","slug":"solved-answer","permalink":"https://longsizhuo.github.io/tags/solved-answer/"}]},{"title":"2639. Query the width of each column in the grid diagram","date":"2023-12-31T13:00:00.000Z","path":"post/5a764983.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"2679.In the matrix and the harmony","date":"2023-12-31T13:00:00.000Z","path":"post/5277100.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Array","slug":"Array","permalink":"https://longsizhuo.github.io/tags/Array/"},{"name":"matrix","slug":"matrix","permalink":"https://longsizhuo.github.io/tags/matrix/"},{"name":"Sort","slug":"Sort","permalink":"https://longsizhuo.github.io/tags/Sort/"},{"name":"simulation","slug":"simulation","permalink":"https://longsizhuo.github.io/tags/simulation/"},{"name":"heap(Priority queue)","slug":"heap(Priority-queue)","permalink":"https://longsizhuo.github.io/tags/heap%EF%BC%88Priority-queue%EF%BC%89/"}]},{"title":"271. Code and decoding of string - Python Add the transposition symbol solution method Dual complexityO(n)","date":"2023-12-31T13:00:00.000Z","path":"post/5992f238.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"solved,answer","slug":"solved-answer","permalink":"https://longsizhuo.github.io/tags/solved-answer/"}]},{"title":"2997. Make an array or harmony K The minimum number of operations","date":"2023-12-31T13:00:00.000Z","path":"post/3109a910.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"solved","slug":"solved","permalink":"https://longsizhuo.github.io/tags/solved/"},{"name":"Bit operation","slug":"Bit-operation","permalink":"https://longsizhuo.github.io/tags/Bit-operation/"}]},{"title":"2998. make X and Y Equal number of operations","date":"2023-12-31T13:00:00.000Z","path":"post/5ee4164.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"Dynamic planning","slug":"Dynamic-planning","permalink":"https://longsizhuo.github.io/tags/Dynamic-planning/"},{"name":"Priority search","slug":"Priority-search","permalink":"https://longsizhuo.github.io/tags/Priority-search/"},{"name":"Memory search","slug":"Memory-search","permalink":"https://longsizhuo.github.io/tags/Memory-search/"}]},{"title":"3072. Allocate elements into two arrays II","date":"2023-12-31T13:00:00.000Z","path":"post/48a38683.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Array","slug":"Array","permalink":"https://longsizhuo.github.io/tags/Array/"},{"name":"simulation","slug":"simulation","permalink":"https://longsizhuo.github.io/tags/simulation/"},{"name":"Tree array","slug":"Tree-array","permalink":"https://longsizhuo.github.io/tags/Tree-array/"},{"name":"Thread tree","slug":"Thread-tree","permalink":"https://longsizhuo.github.io/tags/Thread-tree/"}]},{"title":"345. Voice letter in the reverse string","date":"2023-12-31T13:00:00.000Z","path":"post/1c57c22c.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"350.The intersection of two array","date":"2023-12-31T13:00:00.000Z","path":"post/616577aa.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"Hash table","slug":"Hash-table","permalink":"https://longsizhuo.github.io/tags/Hash-table/"},{"name":"Double pointer","slug":"Double-pointer","permalink":"https://longsizhuo.github.io/tags/Double-pointer/"},{"name":"solved","slug":"solved","permalink":"https://longsizhuo.github.io/tags/solved/"}]},{"title":"445.Two numbersII","date":"2023-12-31T13:00:00.000Z","path":"post/2c4cc46c.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"math","slug":"math","permalink":"https://longsizhuo.github.io/tags/math/"},{"name":"Linked","slug":"Linked","permalink":"https://longsizhuo.github.io/tags/Linked/"},{"name":"recursion","slug":"recursion","permalink":"https://longsizhuo.github.io/tags/recursion/"},{"name":"Stack","slug":"Stack","permalink":"https://longsizhuo.github.io/tags/Stack/"}]},{"title":"538.Convert the binary search tree to cumulative tree","date":"2023-12-31T13:00:00.000Z","path":"post/32401b69.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Binary tree","slug":"Binary-tree","permalink":"https://longsizhuo.github.io/tags/Binary-tree/"}]},{"title":"6275. Make all the minimum operations of all elements in the array II","date":"2023-12-31T13:00:00.000Z","path":"post/4e14482b.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"greedy","slug":"greedy","permalink":"https://longsizhuo.github.io/tags/greedy/"}]},{"title":"6293. Count the number of good array","date":"2023-12-31T13:00:00.000Z","path":"post/81004405.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"unsolved","slug":"unsolved","permalink":"https://longsizhuo.github.io/tags/unsolved/"}]},{"title":"6300. Minimum public value","date":"2023-12-31T13:00:00.000Z","path":"post/fefe18d8.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"6323. Child that divides money the most","date":"2023-12-31T13:00:00.000Z","path":"post/b9130c0e.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"6324. Maximize the great value of the array","date":"2023-12-31T13:00:00.000Z","path":"post/1e6b72b8.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"6331The most prizes won in the two lines make()usage","date":"2023-12-31T13:00:00.000Z","path":"post/14d9382b.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"golang","slug":"golang","permalink":"https://longsizhuo.github.io/tags/golang/"}]},{"title":"6338. Number of methods of monkey collision Weekly","date":"2023-12-31T13:00:00.000Z","path":"post/2aa720ec.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"math","slug":"math","permalink":"https://longsizhuo.github.io/tags/math/"},{"name":"Fast power","slug":"Fast-power","permalink":"https://longsizhuo.github.io/tags/Fast-power/"},{"name":"Weekly","slug":"Weekly","permalink":"https://longsizhuo.github.io/tags/Weekly/"}]},{"title":"6347Number of vowel string within the scope of statistics","date":"2023-12-31T13:00:00.000Z","path":"post/52923acb.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"6351. The scores of the array after the marking all elements","date":"2023-12-31T13:00:00.000Z","path":"post/20116270.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"704. Two -point search","date":"2023-12-31T13:00:00.000Z","path":"post/41f30363.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"76Minimum cover string","date":"2023-12-31T13:00:00.000Z","path":"post/ae10d3c1.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"difficulty","slug":"difficulty","permalink":"https://longsizhuo.github.io/tags/difficulty/"}]},{"title":"Python beat98.40% collectionsofCounter method!","date":"2023-12-31T13:00:00.000Z","path":"post/73b5ce9c.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"solved,answer","slug":"solved-answer","permalink":"https://longsizhuo.github.io/tags/solved-answer/"}]},{"title":"977.Orderly array square","date":"2023-12-31T13:00:00.000Z","path":"post/a386fcdc.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"Sword finger Offer 43. 1~n Integer 1 Number of times","date":"2023-12-31T13:00:00.000Z","path":"post/f0d96a1f.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"solved","slug":"solved","permalink":"https://longsizhuo.github.io/tags/solved/"},{"name":"difficulty","slug":"difficulty","permalink":"https://longsizhuo.github.io/tags/difficulty/"}]},{"title":"121.The best time for buying and selling stocks","date":"2023-12-31T13:00:00.000Z","path":"post/3a21fe32.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Dynamic planning","slug":"Dynamic-planning","permalink":"https://longsizhuo.github.io/tags/Dynamic-planning/"},{"name":"Array","slug":"Array","permalink":"https://longsizhuo.github.io/tags/Array/"}]},{"title":"1222.Can attack the queen of the king","date":"2023-12-31T13:00:00.000Z","path":"post/a6577367.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Array","slug":"Array","permalink":"https://longsizhuo.github.io/tags/Array/"},{"name":"matrix","slug":"matrix","permalink":"https://longsizhuo.github.io/tags/matrix/"},{"name":"simulation","slug":"simulation","permalink":"https://longsizhuo.github.io/tags/simulation/"}]},{"title":"122.The best time for buying and selling stocksII","date":"2023-12-31T13:00:00.000Z","path":"post/a75da5a.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Dynamic planning","slug":"Dynamic-planning","permalink":"https://longsizhuo.github.io/tags/Dynamic-planning/"},{"name":"Array","slug":"Array","permalink":"https://longsizhuo.github.io/tags/Array/"},{"name":"greedy","slug":"greedy","permalink":"https://longsizhuo.github.io/tags/greedy/"}]},{"title":"1253.Reconstruct 2 Line binary matrix","date":"2023-12-31T13:00:00.000Z","path":"post/5c98e66b.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Array","slug":"Array","permalink":"https://longsizhuo.github.io/tags/Array/"},{"name":"matrix","slug":"matrix","permalink":"https://longsizhuo.github.io/tags/matrix/"},{"name":"greedy","slug":"greedy","permalink":"https://longsizhuo.github.io/tags/greedy/"},{"name":"medium","slug":"medium","permalink":"https://longsizhuo.github.io/tags/medium/"}]},{"title":"1333.Restaurant filter","date":"2023-12-31T13:00:00.000Z","path":"post/7f1331bc.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Array","slug":"Array","permalink":"https://longsizhuo.github.io/tags/Array/"},{"name":"Sort","slug":"Sort","permalink":"https://longsizhuo.github.io/tags/Sort/"}]},{"title":"1460.Class ScheduleIV","date":"2023-12-31T13:00:00.000Z","path":"post/d8b8a149.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Priority search","slug":"Priority-search","permalink":"https://longsizhuo.github.io/tags/Priority-search/"},{"name":"In -depth priority search","slug":"In-depth-priority-search","permalink":"https://longsizhuo.github.io/tags/In-depth-priority-search/"},{"name":"picture","slug":"picture","permalink":"https://longsizhuo.github.io/tags/picture/"},{"name":"Topology","slug":"Topology","permalink":"https://longsizhuo.github.io/tags/Topology/"}]},{"title":"146.LRU cache","date":"2023-12-31T13:00:00.000Z","path":"post/b9130c0e.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Hash table","slug":"Hash-table","permalink":"https://longsizhuo.github.io/tags/Hash-table/"},{"name":"Linked","slug":"Linked","permalink":"https://longsizhuo.github.io/tags/Linked/"},{"name":"design","slug":"design","permalink":"https://longsizhuo.github.io/tags/design/"},{"name":"双向Linked","slug":"双向Linked","permalink":"https://longsizhuo.github.io/tags/%E5%8F%8C%E5%90%91Linked/"}]},{"title":"213.Hiccup II","date":"2023-12-31T13:00:00.000Z","path":"post/85beb0bf.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Dynamic planning","slug":"Dynamic-planning","permalink":"https://longsizhuo.github.io/tags/Dynamic-planning/"},{"name":"Array","slug":"Array","permalink":"https://longsizhuo.github.io/tags/Array/"}]},{"title":"2251.The number of flowers during the flowering period","date":"2023-12-31T13:00:00.000Z","path":"post/3a21fe32.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Prefix and","slug":"Prefix-and","permalink":"https://longsizhuo.github.io/tags/Prefix-and/"},{"name":"Hash table","slug":"Hash-table","permalink":"https://longsizhuo.github.io/tags/Hash-table/"},{"name":"Array","slug":"Array","permalink":"https://longsizhuo.github.io/tags/Array/"},{"name":"Sort","slug":"Sort","permalink":"https://longsizhuo.github.io/tags/Sort/"},{"name":"Two -point search","slug":"Two-point-search","permalink":"https://longsizhuo.github.io/tags/Two-point-search/"},{"name":"Orderly collection","slug":"Orderly-collection","permalink":"https://longsizhuo.github.io/tags/Orderly-collection/"}]},{"title":"2490Return ring sentence","date":"2023-12-31T13:00:00.000Z","path":"post/5c07686c.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"String","slug":"String","permalink":"https://longsizhuo.github.io/tags/String/"}]},{"title":"2562.Find the series of the array","date":"2023-12-31T13:00:00.000Z","path":"post/b625a0e1.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Double pointer","slug":"Double-pointer","permalink":"https://longsizhuo.github.io/tags/Double-pointer/"},{"name":"Array","slug":"Array","permalink":"https://longsizhuo.github.io/tags/Array/"},{"name":"simulation","slug":"simulation","permalink":"https://longsizhuo.github.io/tags/simulation/"}]},{"title":"2582.Pillow","date":"2023-12-31T13:00:00.000Z","path":"post/82e09f92.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"math","slug":"math","permalink":"https://longsizhuo.github.io/tags/math/"},{"name":"simulation","slug":"simulation","permalink":"https://longsizhuo.github.io/tags/simulation/"}]},{"title":"2591.Child that divides money the most","date":"2023-12-31T13:00:00.000Z","path":"post/6a9ab144.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"math","slug":"math","permalink":"https://longsizhuo.github.io/tags/math/"},{"name":"greedy","slug":"greedy","permalink":"https://longsizhuo.github.io/tags/greedy/"}]},{"title":"2596.Check the Cavaliers patrol plan","date":"2023-12-31T13:00:00.000Z","path":"post/29546b92.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Array","slug":"Array","permalink":"https://longsizhuo.github.io/tags/Array/"},{"name":"matrix","slug":"matrix","permalink":"https://longsizhuo.github.io/tags/matrix/"},{"name":"simulation","slug":"simulation","permalink":"https://longsizhuo.github.io/tags/simulation/"},{"name":"Priority search","slug":"Priority-search","permalink":"https://longsizhuo.github.io/tags/Priority-search/"},{"name":"In -depth priority search","slug":"In-depth-priority-search","permalink":"https://longsizhuo.github.io/tags/In-depth-priority-search/"}]},{"title":"2 .Two numbers","date":"2023-12-31T13:00:00.000Z","path":"post/fa9db6b8.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"math","slug":"math","permalink":"https://longsizhuo.github.io/tags/math/"},{"name":"Linked","slug":"Linked","permalink":"https://longsizhuo.github.io/tags/Linked/"},{"name":"recursion","slug":"recursion","permalink":"https://longsizhuo.github.io/tags/recursion/"}]},{"title":"213.Hiccup III","date":"2023-12-31T13:00:00.000Z","path":"post/86590614.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Dynamic planning","slug":"Dynamic-planning","permalink":"https://longsizhuo.github.io/tags/Dynamic-planning/"},{"name":"Binary tree","slug":"Binary-tree","permalink":"https://longsizhuo.github.io/tags/Binary-tree/"},{"name":"In -depth priority search","slug":"In-depth-priority-search","permalink":"https://longsizhuo.github.io/tags/In-depth-priority-search/"},{"name":"Tree","slug":"Tree","permalink":"https://longsizhuo.github.io/tags/Tree/"}]},{"title":"630.Class ScheduleIII","date":"2023-12-31T13:00:00.000Z","path":"post/e14241e.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"greedy","slug":"greedy","permalink":"https://longsizhuo.github.io/tags/greedy/"},{"name":"Priority queue","slug":"Priority-queue","permalink":"https://longsizhuo.github.io/tags/Priority-queue/"}]},{"title":"LCP 06.Coin","date":"2023-12-31T13:00:00.000Z","path":"post/66079b7b.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"math","slug":"math","permalink":"https://longsizhuo.github.io/tags/math/"},{"name":"Array","slug":"Array","permalink":"https://longsizhuo.github.io/tags/Array/"}]},{"title":"LCP 50.Gem supply","date":"2023-12-31T13:00:00.000Z","path":"post/762ca698.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"},{"name":"Array","slug":"Array","permalink":"https://longsizhuo.github.io/tags/Array/"},{"name":"simulation","slug":"simulation","permalink":"https://longsizhuo.github.io/tags/simulation/"}]},{"title":"brief_alternate Assignment","date":"2023-12-31T13:00:00.000Z","path":"post/dbbd7d58.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"pandas","slug":"pandas","permalink":"https://longsizhuo.github.io/tags/pandas/"}]},{"title":"GOlanguage# GOlanguage可爱捏","date":"2023-12-31T13:00:00.000Z","path":"post/67fc8613.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"Inline expansion","date":"2023-12-31T13:00:00.000Z","path":"post/2660e935.html","excerpt":"","tags":[{"name":"Composition principle","slug":"Composition-principle","permalink":"https://longsizhuo.github.io/tags/Composition-principle/"}]},{"title":"Some doubt","date":"2023-12-31T13:00:00.000Z","path":"post/941aeb72.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"encryption","slug":"encryption","permalink":"https://longsizhuo.github.io/tags/encryption/"}]},{"title":"math","date":"2023-12-31T13:00:00.000Z","path":"post/a927044d.html","excerpt":"like $\\lim_{x \\to 0} \\frac{\\sin x}{x}$ Rendering $$\\begin{eqnarray} \\lim_{x \\to 0} \\frac{\\sin x + x^2 + x^3}{x} & = & \\lim_{x \\to 0} \\frac{\\sin x }{x} + \\lim_{x \\to 0} \\frac{x^2 }{x} + \\lim_{x \\to 0}\\frac{x^3}{x}\\\\ & = & \\lim_{x \\to 0}\\frac{\\sin x}{x}\\\\ & = & 1\\end{eqnarray}$$","tags":[{"name":"math","slug":"math","permalink":"https://longsizhuo.github.io/tags/math/"}]},{"title":"Sword finger Offer 68 - II. The recent public ancestor of the binary tree","date":"2023-12-31T13:00:00.000Z","path":"post/36f314aa.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"Sword finger Offer II 021. Delete the countdown of the linked list n Node","date":"2023-12-31T13:00:00.000Z","path":"post/3ed2f01c.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"answer","slug":"answer","permalink":"https://longsizhuo.github.io/tags/answer/"}]},{"title":"2085. Public string that has occurred once","date":"2023-11-30T13:00:00.000Z","path":"post/bbe4bff6.html","excerpt":"","tags":[{"name":"Hash table","slug":"Hash-table","permalink":"https://longsizhuo.github.io/tags/Hash-table/"},{"name":"Array","slug":"Array","permalink":"https://longsizhuo.github.io/tags/Array/"},{"name":"String","slug":"String","permalink":"https://longsizhuo.github.io/tags/String/"},{"name":"count","slug":"count","permalink":"https://longsizhuo.github.io/tags/count/"}]},{"title":"1004.Maximum continuity1Number III Maximum continuity1Number III","date":"2022-12-06T14:15:00.000Z","path":"post/ed19b576.html","excerpt":"","tags":[{"name":"Python","slug":"Python","permalink":"https://longsizhuo.github.io/tags/Python/"},{"name":"solved,answer","slug":"solved-answer","permalink":"https://longsizhuo.github.io/tags/solved-answer/"}]}]
\ No newline at end of file
diff --git a/html/Sichuan_Traveler/404.html b/html/Sichuan_Traveler/404.html
index 421b9226e..a2691f2d0 100644
--- a/html/Sichuan_Traveler/404.html
+++ b/html/Sichuan_Traveler/404.html
@@ -649,7 +649,7 @@