Leetcode 517. Super washing machine (greedy method + net output of piped water)

1. Title Link: https://leetcode-cn.com/problems/super-washing-machines/ Let's say there are n super washing machines on the same row. At the beginning, each washing machine may have a certain amount of clothes or it may be empty. In each step of operation, you can select any m (1 < = m < = n) washing machines, and send a piece of ...

Posted by Farside on Wed, 29 Sep 2021 20:02:48 +0200

LeetCode 231.Power of Two is simple

This article belongs to "Conquer LeetCode"One of the series, which began officially in 2021/08/12. Because some of the titles on LeetCode are locked, this series will last at least until the day all the unlocked titles are brushed off. Because LeetCode is still creating new titles, the end date of this series may be forever. In this s ...

Posted by sendoh07 on Tue, 28 Sep 2021 18:04:40 +0200

639. [C + +] decoding method II

Title Description A message containing the letters A-Z is encoded as follows: 'A' -> 1 'B' -> 2 ... 'Z' -> 26 To decode an encoded message, all numbers must be grouped and then mapped back to letters according to the original encoding scheme (there may be many ways). For example, "11106" can be mapped to: "AAJF" ...

Posted by ganeshcp on Mon, 27 Sep 2021 15:02:16 +0200

LeetCode 16-20 question explanation Java version (ten thousand words picture and text explanation LeetCode algorithm question 16-20 = = = = > > > < recommended Collection >)

Question 16. 3Sum Closest Title Description (medium difficulty) and Last question Very similar, but this is to give a target value and find three numbers to make their sum closest to the target value. Solution - violent solution Traverse all cases, then find the sum of the three numbers, compare with the target value, and select the o ...

Posted by CaptianChaos on Mon, 27 Sep 2021 01:47:21 +0200

Chain Table of Leetcode Brush Titles

Chain Table Paper 24.Nodes in a two-way exchange chain table Idea 1: Introduce sentinel node, adopt double pointer pre, cur class Solution(object): def swapPairs(self, head): auxi = ListNode(0,next = head) pre,cur = auxi,head while cur and cur.next: tmp = cur.next cur.next = tmp.next ...

Posted by Gath on Sun, 26 Sep 2021 19:13:25 +0200

LeetCode Title Note_20210926

1.Judgement Count/Even Number Writing: Relevant topic: Swordfinger Offer 21. Adjusting the order of arrays so that odd numbers precede even numbers https://leetcode-cn.com/problems/diao-zheng-shu-zu-shun-xu-shi-qi-shu-wei-yu-ou-shu-qian-mian-lcof/ Normal Writing: Module (Module 2) if( i % 2 != 0 ) //Odd Number if( i% 2 == 0 ) //Even numbers ...

Posted by TimTimTimma on Sun, 26 Sep 2021 18:41:24 +0200

2021.9.25 force buckle - maximum value of sliding window

Title Description: Give you an integer array nums, with a size of   k   The sliding window moves from the leftmost side of the array to the rightmost side of the array. You can only see k in the sliding window   A number. The sliding window moves only one bit to the right at a time. Returns the maximum value in the sliding wind ...

Posted by onyx on Sat, 25 Sep 2021 04:14:05 +0200

[small Y learning algorithm] ⚡ Daily LeetCode punch in ⚡ Figure 40. Post order traversal of binary tree

📢 preface 🌻🌻🌻🌻🌻🌻🌻🌻🌻🌻🌻🌻🌻🌻🌻🌻🌻🌻🌻🌻🌻🌻🌻🌻🌻🌻🌻🌻🌻🌻🌻🌻🌻🌻🌻🌻🌻🌻🌻🌻🌲 Punching out an algorithm problem every day is not only a learning process, but also a sharing process 😜🌲 Tip: the problem-solving programming languages in this column are C# and Java🌲 To maintain a state of learning every day, let's wo ...

Posted by gc40 on Fri, 24 Sep 2021 17:07:28 +0200

[out of order version ● sword finger offer] daily algorithm problem punch in problem solution - Search and backtracking algorithm (topic No. 40,45,61)

Punch in day13 Question 1: Sword finger Offer 55 - I. depth of binary tree Enter the root node of a binary tree to find the depth of the tree. The nodes (including root and leaf nodes) passing from root node to leaf node form a path of the tree, and the length of the longest path is the depth of the tree. For example: Given binary tree [ ...

Posted by Lucky_PHP_MAN on Thu, 23 Sep 2021 17:02:59 +0200

LeetCode 725. Separate linked list / 326. 3 power / Sword finger Offer 62. The last remaining number in the circle (Joseph Ring problem)

725. Separate linked list One question per day on September 22, 2021 Title Description Given a linked list whose head node is root, write a function to separate the linked list into k consecutive parts. The length of each part should be as equal as possible: the length difference between any two parts cannot exceed 1, that is, some parts ma ...

Posted by jurdygeorge on Thu, 23 Sep 2021 15:01:05 +0200