LeetCode 71 Biweekly Contest

Broken thoughts It was absent-minded because the game started ten minutes after the start of all sorts of things. Because of the last rush to brush rankings, the mood is very urgent, ideas are not sorted out on the code As a result, only the first three questions are AC ed, and the last one is really in no mood 5984. Minimum sum of four dig ...

Added by kingleo on Sun, 06 Feb 2022 19:25:33 +0200

CodeTop supplementary question 1 Sort odd ascending even descending linked list

Topic source Supplementary question 1 Sort odd ascending even descending linked list Title details This article is a supplement to the enterprise question bank CodeTop[1], summarizing those high-frequency interview questions that can not be found on Leetcode. Let's take a look at the original narration of several face scriptures In the linke ...

Added by EnDee321 on Sun, 06 Feb 2022 05:16:50 +0200

LeetCode 106. Constructing binary tree from middle order and post order traversal sequence [c++/java detailed problem solution]

1. Title Given two integer arrays inorder and postorder, inorder is the middle order traversal of the binary tree and postorder traversal of the same tree, please construct and return this binary tree. Example 1: Input: inorder = [9,3,15,20,7], postorder = [9,15,7,20,3] Output:[3,9,20,null,null,15,7] Example 2: Input: inorder = [-1 ...

Added by mchaggis on Sun, 06 Feb 2022 04:55:56 +0200

Leetcode-D44-array-48 Rotate image & 54 Spiral matrix (review tomorrow)

1, Review 1,47. Full arrangement II It's not bad. The idea is generally right. It's just a little debugging - when size=0, you can't enter the for loop, so you need to judge when size=1, and then directly append (path), and then return class Solution: def permuteUnique(self, nums: List[int]) -> List[List[int]]: def dsf(size,nu ...

Added by nrg_alpha on Sun, 06 Feb 2022 03:11:03 +0200

[data structure and algorithm] in-depth analysis of the solution idea and algorithm example of "N Queen"

1, Title Requirements The n queen problem studies how to place n queens in n × N's chessboard, and the Queens can't attack each other.Give you an integer n and return the solution of all different queen n problems.Each solution contains a different chess placement scheme for the n-queen problem, in which 'Q' and ' They represent the quee ...

Added by Wolverine68 on Sat, 05 Feb 2022 20:09:42 +0200

In-depth Analysis of Data Structure and Algorithms Solving Ideas and Examples of Alphabetic Word Grouping

1. Title requirements You will be given an array of strings, which you can return in any order by combining heterographic words.Alphabetic words are new words that result from rearranging the letters of the source word, and the letters in all source words are usually used exactly once.Example 1: input: strs = ["eat", "tea", "tan", "ate", "nat ...

Added by iamtom on Sat, 05 Feb 2022 19:14:15 +0200

LeetCode week (278 weeks)

2154. Multiply the found value by 2 Give you an integer array nums, and give you an integer original, which is the first number to search in nums. Next, you need to follow the following steps: If the original is found in nums, multiply the original by 2 to get a new original (that is, make original = 2 * original). Otherwise, stop the pro ...

Added by Cep on Sat, 05 Feb 2022 10:24:25 +0200

Leetcode-D43-array-40 Combined sum II&47 Full arrangement II

1, Review First review the retrospective question written yesterday, and start with the simple one of full arrangement. 46. Full arrangement In fact, this kind of backtracking is quite fun. Unlike dynamic programming, it can remember the details of answer, and all of them are on the path (we use continuous recursive path to record this value, ...

Added by X.Cyclop on Sat, 05 Feb 2022 03:41:55 +0200

"Force buckle algorithm set"

Tip: A list of questions to answer in this blog post 6. Hamming Distance 7. Numbers that disappear 8. Number of 1 in binary Numbers missing in 9.0-n-1 10.Number of 1 of the first n digit binaries 11. Number I appears only once 12. Number II appears only once 13. Number III appears only once 14. Number IV appears only once Preface T ...

Added by wenquxing on Fri, 04 Feb 2022 19:59:40 +0200

Day 24 of leetcode brushing - 1725, 47, 39, 40

Day 24 1725 number of rectangles that can form the largest square Give you an array of rectangles, where rectangles[i] = [li, wi] indicates that the length of the ith rectangle is li and the width is wi. If k satisfies both k < = Li and k < = wi, the i-th rectangle can be cut into a square with side length k. For example, a rectangle [ ...

Added by TheWart on Fri, 04 Feb 2022 11:49:58 +0200