20211127_datawhale31_ leetcode brush title_ 4 Double pointer and sliding window

Four Array Double Pointer and Slide List Images Source: https://realpython.com/ source Datewhale31_u LeetCode Title: Route pioneer: Yang Shichao Navigator: Liu Jun Sailors: Yang Shichao, Li Yanpeng, Ye Zhixiong, Zhao Zi Open Source Content https://github.com/itcharge/LeetCode-Py Open source e-books https://algo.itcharge.cn 1 Arra ...

Posted by natepizzle on Sat, 27 Nov 2021 09:34:40 -0800

Tencent two-sided algorithm problem: circle of friends problem

Hello, I'm a senior programmer~ Today, let's share a Tencent two-sided algorithm problem, basin friend circle problem~ If you like, remember to pay attention~ Circle of friends problem There are now 105 users numbered 1 - 105. It is known that there are m pairs of relationships. Each pair of relationships gives you two numbers x and y, represen ...

Posted by oni-kun on Fri, 26 Nov 2021 19:52:50 -0800

Strange upgrade - 8. String to integer (atoi)

Title Description Please realize one   myAtoi(string s)   Function to convert a string into a 32-bit signed integer (similar to the atoi function in C/C + +). ​ function   The algorithm of myAtoi(string s) is as follows: ​ Read in the string and discard useless leading spaces Check whether the next character (assuming it has n ...

Posted by AL123 on Fri, 26 Nov 2021 18:20:30 -0800

[LeetCode learning plan] algorithm introduction C + + day 7 breadth first search / depth first search

733. Image rendering LeetCode simple single \color{#00AF9B} {simple} simple There is a picture represented by a two-dimensional integer array. Each integer represents the pixel valu ...

Posted by Boo-urns on Fri, 26 Nov 2021 04:24:07 -0800

257. All paths of binary tree

Here's the code you can't write clearly! It's a concept called backtracking. Because the parameters here are written in the way of passing reference, if you change one branch line, the other will also change. When you stack again, you will add more NIMA. In addition, it's not good to set the recursive base to an empty node here, because every ...

Posted by kiltannen on Thu, 25 Nov 2021 14:49:22 -0800

leetcode essence of algorithm interview in Dachang 5. Binary search

leetcode essence of algorithm interview in Dachang 5. Binary search Video tutorial (efficient learning): Click to learn catalog: 1. Introduction 2. Time and space complexity 3. Dynamic planning 4. Greed 5. Binary search 6. Depth first & breadth first 7. Double pointer 8. Sliding window 9. Bit operation 10. Recursion & divide and conquer ...

Posted by Adamthenewbie on Tue, 23 Nov 2021 22:03:48 -0800

[edit distance problem] and output the editing process through backtracking

Title Description: Given a source string and a target string, the following operations can be performed on the source string: Insert a character at any position; Replace any character; Delete any character. Write a program to return the minimum number of operations, so that the source string is equal to the target string after the above operat ...

Posted by Crayon Violent on Tue, 23 Nov 2021 14:55:12 -0800

leetcode lecture on algorithm interview in Dachang 3. Dynamic programming

leetcode lecture on algorithm interview in Dachang 3. Dynamic programming Video tutorial (efficient learning): Click to learn catalog: 1. Introduction 2. Time and space complexity 3. Dynamic planning 4. Greed 5. Binary search 6. Depth first & breadth first 7. Double pointer 8. Sliding window 9. Bit operation 10. Recursion & ...

Posted by GetReady on Sun, 21 Nov 2021 23:42:37 -0800

Lecture 5 dynamic programming

AcWing 2. 01 knapsack problem State representation f ( i , j ) f(i, j) f(i,j) represents the optimal solution of the first i articles in the ca ...

Posted by paparanch on Sun, 21 Nov 2021 15:01:48 -0800

Greedy algorithm C++ puzzle (leetcode101 (biscuit allocation 455 (candy allocation 135) (interval problem 435)

Basic Ideas: Local Optimal - >Global Optimal Difficulty: Determine the best "what object" Simple questions: Find money: a total of x Yuan with a minimum of several pieces of money 100 yuan 50 yuan 10 yuan 5 yuan 1 yuan Idea: x divides 100, 50, 20, 10, 5, 1 Integer division adds up leetcode 455 Allocate cookies Suppose you're a ...

Posted by amreiff on Sun, 21 Nov 2021 10:53:40 -0800