LeetCode algorithm
Most bogey, hope to do a series of articles to record the process of brushing algorithm.
At present, it is mainly based on LeetCode https://leetcode-cn.com/circle/article/48kq9d/ The module of this post will brush the questions.
The content is mainly the summary of the landlord in the post, as well as some personal experience ...

Posted by shak123 on Thu, 19 May 2022 20:46:21 +0300

0. Always say
It's time to pick up your studies that have been neglected for so long. Today is 2022-05-18. Brush at least two questions every day. I've written the first few times and directly abbreviated them.
1. 1. Sum of two numbers
1. Title Description
2. Topic analysis
Traverse to find two numbers with mapping relationship, so y ...

Posted by php3ch0 on Thu, 19 May 2022 01:06:23 +0300

Topic description
Given an array nums of n integers, are there elements a, b, c in nums such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.
Now given an array of n integers, look for three numbers that add up to 0. Find all the different groups, each group consists of three numbers, and the sum of the t ...

Posted by BlueSkyIS on Wed, 18 May 2022 09:50:36 +0300

Constantly updating
Problem solution
455 distribution of biscuits
Suppose you are a great parent and want to give your children some cookies. However, each child can only give one biscuit at most. For each child i, there is an appetite value gi, which is the minimum size of biscuits that can satisfy the children's appetite; And every cookie ...

Posted by mechamecha on Wed, 18 May 2022 06:40:12 +0300

Digital problem
9. Number of palindromes
Algorithm idea: 1. First, judge whether x is a negative number. If it is a negative number, it directly returns false without conversion 2. Assign the palindrome number y according to the flashback until Y > = X. at this time, if x = = y | x = = Y / 10, it is the palindrome number, otherwise it ...

Posted by elwadhos on Tue, 17 May 2022 18:01:13 +0300

232. Implement queue with stack (simple)
Use the stack to implement the following operations of the queue:
push(x) -- put an element at the end of the queue.
pop() -- removes the element from the queue header.
peek() -- returns the element at the head of the queue.
empty() -- returns whether the queue is empty.
Example:
MyQueue queue = new MyQ ...

Posted by marian on Tue, 17 May 2022 14:29:27 +0300

I spent a few days selecting five topics with the same ideas from the force button to help you solve the problem. If you think the article is useful to you, remember to praise and share it. Let me see your recognition and have the motivation to continue to do it.
467. The unique substring in the surrounding string (medium)
795. Number of int ...

Posted by caspert_ghost on Sat, 14 May 2022 09:02:30 +0300

LeetCode_ Interview question 01.05 Primary edit [medium]
Topic:
Title:
There are three editing operations for Strings: insert a character, delete a character, or replace a character. Given two strings, write a function to determine whether they require only one (or zero) edit.
Example 1:
input:
first = "pale"
second = "ple"
output: Tru ...

Posted by Tyrant on Fri, 13 May 2022 23:56:30 +0300

D124 1175. Prime Arrangements
Title Link
1175. Prime Arrangements
Topic analysis
This question, give a number n to generate an array from 1 to N. how many permutations make the number of prime digits prime? Where 1 < = n < = 100
Since the final return value may be large, please return the result after mod (10 * * 9 + 7).
thinking
In other ...

Posted by raquelzinha on Fri, 13 May 2022 17:15:13 +0300

In ACM algorithm competition / LeetCode using C + + to brush questions and other scenarios, usually:
A lot of C + + source code needs to be maintained
Multiple main function entries are required to facilitate test execution
Some self written public function class libraries (such as debug output vector, etc.) are referenced in multiple files
T ...

Posted by DarkendSoul on Thu, 12 May 2022 18:47:09 +0300