Tag：subject

Time：202136
124. Maximum path sum in binary tree Title Source: leetcode https://leetcodecn.com/problems/binarytreemaximumpathsum subject Given a nonempty binary tree, the maximum path sum is returned. In this problem, the path is defined as a sequence from any node in the tree to any node. The path contains at least one node and does not necessarily pass through […]

Time：202134
The longest ascending subsequence is a classical algorithm problem. Some will ask you to find the longest ascending subsequence directly, others will put it another way, but the final investigation is the longest ascending subsequence. So the problem is, you can still see it in clothes, can’t you? If you can’t see it at all, […]

Time：202133
67. Binary summation Title Source: leetcode https://leetcodecn.com/problems/addbinary subject Give you two binary strings and return their sum (in binary). The input is a non empty string and contains only the numbers 1 and 0. Example 1: Input: a = – 11 “, B = – 1” Output: “100” Example 2: Input: a = – 1010 […]

Time：202131
1. SQL question description In other words, there is a log table with only two columns, namely continuous ID and num. as for what it means, treat it as the amount. Now if you want to know num for 3 times or more, the data is as follows id num 1 1 2 1 3 […]

Time：2021226
Recently, I met Alibaba’s outsourcing company, but I have to knock the code online. That’s a tension. The topic is to implement a cache of LRU algorithm. Outsourcing is so demanding, eh. Fortunately, LRU is a topic assigned by my university teacher. Of course, I implemented it in C language. The principle of the algorithm […]

Time：2021225
Example: missing first positive number Source: leetcode Link:https://leetcodecn.com/probl… In situ hash Example: Missing first positive number Difficulty: hard describe To give you an unsorted integer array, please find the smallest positive integer that does not appear in it. Examples Example 1: Input: [1,2,0] Output: 3 Example 2: Input: [3, 4, – 1, 1] Output: 2 […]

Time：2021224
Main idea: Give a start word beginword and an end word Endword, and then give a word list wordlist. From beginword to Endword, only one letter can be changed at a time, and the word is wordlist. Solutions: In fact, it is a disguised BFS. It looks for the adjacent words that can be transformed […]

Time：2021217
0. Preface Simple topics, but without practice or recitation, may not be able to write out. In an interview, you often finish them in a short time. You don’t have time to draw pictures and deduce them. These can only be quickly completed in your mind. Sometimes after a long time, you feel that you […]

Time：2021214
Leetcode165For example, the first thing to do in this topic is to divide the string by ‘. Here are two ways I summarize to split strings.Firstly, istringstream and getline are used for segmentation string version1 = “1.0.0.1”; vector<int> v1; istringstream s1(version1); string temp; while(getline(s1,temp,’.’)){ v1.push_back(stoi(temp)); } Secondly, there is a fool’s solution string version1 = […]

Time：2021211
Title:Input three integers x, y, Z, please output these three numbers from small to large. Program analysis:We try to find a way to put the minimum number on X. first, we compare x with y. if x > y, we exchange the value of X with y, and then we compare x with Z. if […]

Time：202129
I didn’t know you when I put on my clothes? Let’s talk about the longest ascending subsequence, which has received unanimous praise. Today, we are still bringing you the skin changing topic – the longest common subsequence series. The longest common subsequence is a classical algorithm problem. Some will directly ask you to find the […]

Time：202126
I used Python to write a script to generate index automatically Introduction: in order to solve the algorithm problems, a GitHub warehouse is builtPiperLiu / ACMOI_JourneyRecord their own brush topic track, and summarize the method, experience. Think of a requirement: can I use the program to automatically classify and create an index after I add […]