[data structure and algorithm] in-depth analysis of the solution ideas and algorithm examples of "different paths"

1, Title Requirements A robot is located in the upper left corner of an m x n grid (the starting point is marked as "Start" in the figure below). The robot can only move down or right one step at a time. The robot tries to reach the lower right corner of the grid (marked as "Finish" in the figure below). How many different ...

Added by chris_s_22 on Wed, 09 Feb 2022 23:34:09 +0200

Split palindrome string

According to the problem solution summary of code Capriccio thinking This topic involves two key issues: 1. How to cut 2. Judge whether palindrome In fact, the cutting problem is similar to the combinatorial problem. So we need to use backtracking to cut strings. For example, for the string abcdef: Combinatorial problem: after selecting a ...

Added by turtlekid8 on Wed, 09 Feb 2022 19:26:00 +0200

Force buckle 1707 - the maximum XOR value of the element in the array

Key points of algorithm: 01Trie reference resources: 01Trie Offline query and online query01some statistical information of subtree can be additionally maintained in trie node $1 title Title Link 1707. Maximum XOR value with elements in the array Title Description Give you an array of nonnegative integers, nums. There is also a query ...

Added by FlashbackJon on Tue, 08 Feb 2022 15:54:10 +0200

[Leetcode] game 71 biweekly

preface In the second week of the competition, a got the first two questions. The third question was not done because he ordered to eat. It's not difficult to look back. But whether it can be done in the official competition is not necessarily ha ha. come on. 5984. Minimum sum of the last four digits after splitting Topic display Inte ...

Added by thecard on Tue, 08 Feb 2022 13:49:00 +0200

Sword finger offer 26.27.28 search and backtracking algorithm (simple) DFS of binary tree

26. Title: Sword finger Offer 26 Substructure of treehttps://leetcode-cn.com/problems/shu-de-zi-jie-gou-lcof/ Idea: first, find the root node of B in A. if it is found, compare AB from now on. Otherwise, return false Note that when B==null, it is not a substructure of any tree and can be judged first Two recursions are involved: Recur ...

Added by nuxy on Tue, 08 Feb 2022 10:24:45 +0200

[leetcode SQL daily practice] - 595 Big country

   🎈 Write in front 🙋‍♂️ Hello everyone, I'm super dream. You can call me Xiaomeng~ We all know that we have to deal with the database almost every day, whether in study or daily work. In order to better operate the database, our SQL knowledge reserve is essential. If you want to master SQL well, you must practice and stu ...

Added by Slippy on Tue, 08 Feb 2022 08:20:18 +0200

Leetcode notes -- a classic title of stack and queue

Catalogue of series articles I Array type problem solving method 1: dichotomy II Array type problem solving method 2: Double finger needle method III Array type problem solving method 3: sliding window IV Array type problem solving method 4: simulation V The basic operation and classic topics of the linked list Vi Classic title of hash tab ...

Added by Erkilite on Mon, 07 Feb 2022 21:09:35 +0200

Digital mobile (basic)

Title Description Arrange 1 ∼ n in order to form a sequence. The number I is just in position i. Then give a position sequence p1,p2,..., pn with length N, which is an arrangement of 1 ∼ n. Next, we will repeatedly perform the following operations on the sequence: Rearrange the position of each number in the sequence and move the nu ...

Added by bow-viper1 on Mon, 07 Feb 2022 09:19:24 +0200

LeetCode 1219. Gold miner / 1748 Sum / 1405 of unique elements Longest happy string

1219. Gold miners 2022.2.5 one question per day Title Description You want to develop a gold mine. Geological surveyors have identified the distribution of resources in the gold mine and marked it with a grid of size m * n. The integer in each cell represents the amount of gold in this cell; If the cell is empty, it is 0. In order to maximi ...

Added by NoReason on Mon, 07 Feb 2022 07:44:48 +0200

Summary of leetcode's simulated problem brushing 2

Summary of leetcode's simulated problem brushing 2 1-remodeling matrix Title Link: Title Link stamp here!!! Idea: simulate the matrix remodeling process. If the number of elements of the original matrix and the remodeling matrix is different, the remodeling cannot be completed. On the contrary, the remodeling can be completed. First convert t ...

Added by coreyp_1 on Mon, 07 Feb 2022 04:32:27 +0200